User32: This
provides the Windows look and feel for buttons and textboxes and other UI
elements. User32 lacked drawing capabilities.
GDI (Graphics
Device Interface): Microsoft introduced GDI to provide drawing capabilities.
GDI not only provides drawing capabilities but also a high level of abstraction
on hardware display. In other words, it encapsulates all complexities of
hardware in the GDI API.
GDI+: GDI+
was introduced which basically extends GDI and provides extra functionalities
like JPG and PNG support, gradient shading, and anti-aliasing. The biggest
issue with the GDI API was it did not use hardware acceleration and did not
have animation and 3D support.
Note:
Hardware acceleration is a process in which we use hardware to perform some
functions rather than performing those functions using software running in the
CPU.
DirectX: The
biggest issues with GDI and its extension GDI+ are hardware acceleration and
animation support. This came as a big disadvantage for game developers. To
answer and serve game developers, Microsoft developed DirectX. DirectX
exploited hardware acceleration, had support for 3D, full color graphics, media
streaming facility, and lots more. This API did not mature in the gaming
industry.
WPF: DirectX had this excellent feature of using hardware acceleration. Microsoft
wanted to develop UI elements like textboxes, buttons, grids, etc., using the
DirectX technology by which they could exploit the hardware acceleration
feature. As WPF stands on top of DirectX, you can not only build simple UI
elements but also go one step further and develop special UI elements like Grid, FlowDocument,
and Ellipse. Oh yes, you can go one step further and build animations. WPF
is not meant for game development. DirectX still will lead in that scenario. In
case you are looking for light animation (not game programming), WPF will be a
good choice. You can also express WPF using XML which is also called as XAML.
In other words, WPF is a wrapper built over DirectX. Let’s now define WPF.
WPF is a
collection of classes that simplifies building dynamic user interfaces. Those
classes include a new set of controls, some of which mimic old UI elements
(such as Label, TextBox, Button), and some that are new (such as Grid, FlowDocument,
and Ellipse).
XAML: XAML
(pronounced as Zammel) is a declarative XML-based language by which you can
define objects and properties in XML. A XAML document is loaded by a XAML
parser. The XAML parser instantiates objects and sets their properties. XAML
describes objects, properties, and the relations between them. Using XAML, you
can create any kind of objects, graphical or non-graphical. WPF parses the XAML
document and instantiates the objects and creates the relations defined by the
XAML. So XAML is an XML document which defines objects and properties and WPF
loads this document in actual memory.
WPF XAML is
used to describe WPF content, such as WPF objects, controls, and documents. In
WPF XAML, we also have XPS XAML which defines an XML representation of
electronic documents.
Silverlight
XAML is a subset of WPF XAML meant for Silverlight applications.
Silverlight is a cross-platform browser plug-in which helps us create rich web
content with two-dimensional graphics, animation, and audio and video.
WWF XAML helps
us describe Windows Workflow Foundation content. The WWF engine then uses this
XAML and invokes the workflow accordingly
Silverlight
is a web browser plug-in by which we can enable animations, graphics, and
audio/video. You can compare Silverlight with Flash. We can view animations
with Flash and it’s installed as a plug-in in the browser.
Yes,
animations made in Silverlight can run in other platforms other than Windows.
In whatever platform you want to run, you just need the Silverlight plug-in.
Yes, there is
something called as a WPF browser application which can run WPF in the browser.
For a WPF browser application, you need the .NET Framework to be installed in
the client location while for Silverlight, you need only the plug-in. So in
other words, WPF browser applications are OS dependent while Silverlight is
not. A Silverlight plug-in can run in OSs other than Windows while we all know
the .NET Framework only runs in Windows.
CONCLUSION
XAML is an XML file which defines UI elements. This XML file can be read by the WPF framework or Silverlight framework for rendering. Microsoft first developed WPF and they used XAML files to describe UI elements to the WPF framework. Microsoft then extended WPF and made WPF/e which helped to render the UI in the browser. WPF/e was the code name for Silverlight. Later Microsoft launched Silverlight officially. So the XAML just defines the XML structure to represent UI elements. Both the frameworks, i.e., WPF and Silverlight, then read the UI elements and render the UI elements in the respective platform.
No comments:
Post a Comment