Short Courses on Computer Graphics, Image Processing and Computer Vision
Let me know what you think Mail me...

Course 2D_WPF: 2D-Computer Graphics with C# + WPF

Copyright © by V. Miszalok, last update: 2011-01-31

Visitors since 01-01-2002
Please notice: Introduction into all courses
deutsch english
Was ist WPF ?
Windows und Graphik-Treiber auf neustem Stand ?
Visual C# 2010 Express
Bücher
Tutorials
C1: Intro, erste Graphikbefehle
C2: Draw, ein Malprogramm
What is WPF ?
Update Windows and its Graphics Driver
Install Visual C# 2010 Express
Books
Tutorials
C1: Intro, some simple graphic commands
C2: Draw, a scribble program

Was ist WPF ?

Die Windows Presentation Foundation ist die Programmierschnittstelle (Application Programming Interface API) von Windows 7 und Vista.

Näheres im WPF-Kapitel der Vorlesung: ../Lectures/L05_OpenGL_DirectX/OGL_DX_d.htm.

What is WPF ?

The Windows Presentation Foundation is a class library for all sorts of Graphical User Interfaces GUIs and is the central Application Programming Interface API of Windows 7 and Vista. With WPF you can develop stand-alone EXEs and Frontends of distrubuted applications and browser applications.
WPF contains two APIs which can be arbitrarily mixed: You can write the pogram in C# or in XAML or both.
Prognosis: WPF will replace Windows-Forms.
Advantages:
1) WPF is a rich and highly structured tool box for Windows- and Web-GUIs.
2) WPF everywhere in form of Windows-GUI, as Web page and on mobile devices.
3)
With Expression Studio and XAML beautiful GUIs and Web pages can be developed without programming.
4)
WPF generates only vector graphics (except textures and videos) similar to Flash.
5) WPF renders in a very fast way at run time via DirectX.
Disadvantages:
1) It is hard to learn how to use the multiple rich and big class libraries.
2) It warps into useless graphic baubles of any sort.

Windows und Graphik-Treiber auf neustem Stand ?

1. Laden und installieren Sie via Windows Internet Explorer → Extras → Windows Update die neuesten Updates für Ihr Betriebssystem.
2. Starten Sie das DirectX-Diagnoseprogramm C:\Windows\System32\dxdiag.exe (oder wo es auch immer sei auf Ihrer Festplatte).
3. Auf der dxdiag-Anzeige-Karteikarte stehen Hersteller und Typ Ihrer Graphikkarte.
4. Suchen Sie im Internet den Hersteller und laden Sie den neuesten Treiber für Ihre Karte und installieren Sie diesen.
5. Testen Sie den Erfolg mit dxdiag.exe.

Update Windows and its Graphics Driver

1. Load and install the most recent updates of Your operating system via Windows Internet Explorer → Extras → Windows Update.
2. Test the DirectX properties of Your graphic board as follows: Start C:\Windows\System32\dxdiag.exe (or wherever it may be on the hard disk).
3. Check the manufacturer and the type of Your graphics card on the dxdiag-Display-tab .
4. Search the manufacturer on the internet and download the newest driver version of the card and install it.
5. Test again whether the update succeeded with dxdiag.exe.

Visual C# 2010 Express

Sie brauchen Visual C# 2010 Express oder Visual Studio 2010 Professional .
Sie finden Visual C# 2010 Express unter: www.microsoft.com/express/vcsharp/Default.aspx

Visual C# 2010 Express

You need Visual C# 2010 Express or Visual Studio 2010 Professional.
Download Visual C# 2010 Express from: www.microsoft.com/express/vcsharp/Default.aspx

Bücher

1. KÜHNEL Andreas: Visual C# 2010
Kostenloses HTML-Buch von Galileo (1295 Seiten)

2. MARQUARDT Bernd: Windows Presentation Foundation Crashkurs. Microsoft Press, ISBN: 978-3-86645-504-7, € 29,90 (380 Seiten)

Books

1. MACDONALD Matthew: Pro WPF in C# 2010.
APress, ISBN: 978-1-4302-7205-2, $ 55.-- (1040 p.)

Tutorials

1. https://www.microsoft.com/germany/msdn/webcasts/...:
WPF - Tutorial von Dirk Frischalowski, gute Einführung, aber nicht mehr auf neuestem Stand.

2. http://www.microsoft.com/germany/msdn/webcasts/...:
10-teiliger Videokurs von Bernd Marquard über WPF.

3. www.microsoft.com/germany/msdn/webcasts/...:
9-teiliger Videokurs von Bernd Marquard, Jana Paetzold und Oliver Scheer über XAML.

Tutorials

1. Microsoft: MSDN: WPF

2.
Lee Brimelow: http://www.contentpresenter.com/.

C1: Intro, erste Graphikbefehle

Schreiben Sie ein erstes zweckloses Programm mit der neuen Windows Presentation Foundation WPF. Es enthält den Hello-World-Text, es erfragt die dehnbare Fenstergröße, schreibt zwei Linien, ein Rechteck, eine Ellipse. Das Fenster zoomt sich selbst und animiert sein Zentrum mit einem rotierenden Farbrad.

     
   

C1: Intro, some simple graphic commands

Write a first useless C#-program with the new Windows Presentation Foundation WPF that demonstrates some simple graphic commands. It demonstrates a Hello-World-text, it evaluates the variable window size, draws two lines, a rectangle and an ellipse. The window zooms up and down and animates its center by a permanently rotating brush.

EXE Demo.exe → Start it online
Vers. a) Written in XAML and C#
Link C# Guidance
PDF C# Guidance Print Version
Link C# Complete Code
PDF C# Complete Code Print Version
Vers. b) Written in C# only
Link C# Guidance
PDF C# Guidance Print Version
Link C# Complete Code
PDF C# Complete Code Print Version
Link C# Code Comments
PDF C# Code Comments Print Version

C2: Draw, ein Malprogramm

Schreiben Sie ein Zeichenprogramm mit der neuen Windows Presentation Foundation WPF. Es zeichnet fortlaufend die Mausbewegungen bei gedrückter Maustaste, schließt das Polygon beim Loslassen und berechnet Umfang, Fläche, umschreibendes Rechteck und zwei Mittelpunkte. Zoom- und Drehanimation. Letzter Schritt ist die Speicherung der Zeichnung und der Ergebnisse als XAML-Datei, die vom IE-Browser gelesen werden kann.

     
   

C2: Draw, a scribble program

Write a drawing program with the new Windows Presentation Foundation WPF. It draws the mouse movements, closes the polygon on mouse button up, computes perimeter, area, bounding box and two mid points. Zoom and rotate animation. Last step: Save the drawing and its results as XAML-file which can be read by the IE-Browser.

EXE Demo.exe → Start it online
Vers. b) Written in C# only
Link C# Guidance
PDF C# Guidance Print Version
Link C# Complete Code
PDF C# Complete Code Print Version
top of page: