0% found this document useful (0 votes)
7 views6 pages

WPF Graphics Development Techniques

The document outlines a course on graphical interfaces using WPF.Net, focusing on its architecture and features such as hardware acceleration and resolution independence. It introduces XAML as a declarative language for separating graphical design from code, facilitating collaboration between developers and artists. Additionally, it provides a brief guide on creating a simple WPF application and explains the use of the Grid layout in WPF.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

WPF Graphics Development Techniques

The document outlines a course on graphical interfaces using WPF.Net, focusing on its architecture and features such as hardware acceleration and resolution independence. It introduces XAML as a declarative language for separating graphical design from code, facilitating collaboration between developers and artists. Additionally, it provides a brief guide on creating a simple WPF application and explains the use of the Grid layout in WPF.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Course Title

Techniques de developpement dans un environnement graphique II

-Course#01-

Graphical interfaces in [Link]

Session Course code


420-B05-RO
Autumn 2021

Group Teacher
38426 Naïm Himrane
Introduction to WPF
"Windows Presentation Foundation" (WPF) is a modern graphics display system for Windows. It is about
a radical change compared to the technologies that preceded it, with innovative features such as
que l'accélératon matérielle intégrée (DirectX) et l'indépendance de la résoluton, que vous explorerez toutes les
two in this chapter.

WPF is not only used to display the graphical interface of software such as word processors, games, etc., it
also provides an advanced execution environment for web application creation: Silverlight.

The architecture of WPF

Figure 1 The WPF architecture1

[Link]: it contains the high-level WPF types, including those that represent
windows, panels, and other types of controls, styles... etc.

[Link]: it contains basic types, such as user interfaces, all forms and all
controls derive from these classes.

[Link]: the content still has more basic ingredients likely to be reused outside of WPF, such as
that "DispatcherObject" and "DependencyObject", which provide the plumbing for dependency properties.

[Link]: it is the heart of the WPF rendering system and the foundation of the Media Integration Layer (MIL). Its engine
Composition translates the visual elements in the triangle and the textures expected by Direct3D.

[Link]: this is a low-level API that provides imaging support (for example, the
processing, displaying and scaling of bitmaps and JPEGs.

1
MacDonald, Matthew. Pro WPF 4.5 in C#.
Direct3D: This is the low-level API through which all graphics of a WPF application are rendered.

User32: includes most of the basic Windows APIs, including windows and native controls, and many others
things.

XAML
Windows Presentation Foundation (WPF) integrates the descriptive language XAML.2which allows to use it from a
close to a HTML page for developers.

Developers always strive to separate the graphical part from the underlying code. It is the most effective way.
to tackle complex and graphically rich applications. In this way, artists can own the
graphics and developers can own the code. Both pieces can be designed and refined
separately, without any version issues.

<Window x:Class="WindowsApplication1.Window1">
xmlns[Link]
presentation
xmlns:x="[Link]
Title="Window1" Height="300" Width="300">
<Grid>
</Grid>
</Window>

XAML is a declarative language in the sense that it defines WHAT and HOW you want to do. The XAML processor
is responsible for the HOW to do it part. (Figure 2)

Figure 2. Operation of XAML

2
Extensible Application Markup Language.
Create a WPF application
First WPF application

1- Create a WPF project: 'FirstWPFApplication'


2- Create a C# class: Response Generator: "ResponseGenerator"
string[] responses = new string[]{
["Ask again later","Cannot predict now"]
["Without a doubt","Is it really like this"]
Focus and ask again
["My sources say no","Yes, definitely"]
["Don't count on it","The signs say Yes"]
It's better not to tell you now
"Les perspectives ne sont pas si bonnes","Très probablement",
["Very doubtful","As I see it, yes","My answer is no","It is certain"]
["Yes","You can rely on it","The prospects are good"]
Respond to Hazy Try Again

And a function: ReturnRandomResponse() that returns a random response.

Use the class "Random choice = new Random();

return reponses [[Link](0, [Link])];

The Grid

The star defines a column or a row. The star used alone indicates to use all the remaining space in
the space of the Grid.

You might also like