Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Drawing with DirectDraw & GDI

0.00/5 (No votes)
24 May 2002 2  
Drawing Graphics fast with DirectDraw than with GDI

Sample Image - Drawing.jpg

Sample Image - Drawing1.jpg

Software required to build the project:

  1. Visual C++ 6.0
  2. Direct X 7.0 SDK

Software required to run the Demo:

  1. DirectX 7.0
  2. Windows 2000 or Win 9x
  3. The system color must be 32 bits

Introduction

Drawing is a DLL to develop graphics software and games. You can use it to display standard image formats (BMP, Jpeg, Png, tiff...). Also you can draw normal graphics (line, circle, rectangle...) with it. Drawing has a trait that change the draw engine at any moment. You can draw something with DirectDraw or GDI, certainly DirectDraw is faster and better than GDI.

The code

Drawing DLL consists of the following classes:

  1. CCanvas
  2. CCanvasImpl
  3. CDDCanvasImpl
  4. CGDICanvasImpl
  5. NDDSCreen
  6. NDDSurface
  7. CMemDC

Drawing DLL class structure:

Sample Image - Drawing.jpg

Note

When you use Drawing DLL, you can Create a CCanvas object and do your drawing work with it.

At last you use canvas.refresh() to draw the screen.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here