Skip to content

ATF Using Direct2D Sample

Gary edited this page Mar 17, 2015 · 3 revisions

Table of Contents

Description

UsingDirect2D is a sample application that demonstrates how to use Direct2D and ATF classes that support Direct2D. It draws a sequence of graphics objects in a window. It does not use MEF.

ATF Features Demonstrated by UsingDirect2D

  • Use ATF Direct2D classes, such as D2dHwndGraphics, D2dTextFormat and D2dBitmapBrush.
  • Demonstrate ATF vector math classes, such as Matrix3x2F.

Run UsingDirect2D

  1. Double-click the UsingDirect2D.exe in \bin\wws_atf\Release.
  2. A dialog appears showing the first in a sequence of graphics drawings.

How to Use UsingDirect2D

UsingDirect2D draws a sequence of graphics in a window to demonstrate various Direct2D capabilities. Each drawing shows a particular type of graphics object. For instance, the first drawing in the sequence contains 500 rectangles with a gradient. The window title indicates what type of graphics objects were drawn. Press the down or up cursor keys to go to the next or previous in the sequence. Press the "t" key to run a performance test for each drawing.

UsingDirect2D Modules

Modules perform these functions:

  • Program.cs: Contains the Main program.
  • Form1.cs: Draws a sequence of drawings using Direct2D and ATF helper classes.
  • GdiCanvas.cs: Draws various graphics using GDI. This is currently unused.

Topics in this section

Clone this wiki locally