Click here to Skip to main content
15,883,917 members
Articles / Desktop Programming / MFC
Article

Drawing with DirectDraw & GDI

Rate me:
Please Sign up or sign in to vote.
4.88/5 (11 votes)
24 May 2002 300.2K   13.8K   68   37
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


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralPolyline and Polygon Pin
Paul Selormey1-Aug-02 15:48
Paul Selormey1-Aug-02 15:48 
GeneralSpeed Tests Pin
.dan.g.28-May-02 20:30
professional.dan.g.28-May-02 20:30 
GeneralRe: Speed Tests Pin
vistra13-Jul-03 19:35
vistra13-Jul-03 19:35 
GeneralRe: Speed Tests Pin
.dan.g.14-Jul-03 15:16
professional.dan.g.14-Jul-03 15:16 
GeneralThanks all of you!!! Pin
marb26-May-02 18:35
marb26-May-02 18:35 
GeneralIt looks not bad! Pin
26-May-02 3:55
suss26-May-02 3:55 
GeneralA small note Pin
Daniel 'Tak' M.26-May-02 0:45
Daniel 'Tak' M.26-May-02 0:45 
GeneralRe: A small note Pin
Ben Kloosterman12-Nov-02 18:34
Ben Kloosterman12-Nov-02 18:34 
They have not dropped it at all in fact it is a major direction. The windows desktop will move to GDI / DirectX and Microsoft has instructed vidio card manufacturers to expect 2D and 3D in the same pipeline.


GeneralRe: A small note Pin
jor5-Dec-02 5:10
jor5-Dec-02 5:10 
QuestionNon-game display? Pin
Stan Shannon25-May-02 4:21
Stan Shannon25-May-02 4:21 
AnswerRe: Non-game display? Pin
Paul M Watt25-May-02 8:21
mentorPaul M Watt25-May-02 8:21 
GeneralIt's neat! Pin
Wang Huaizhi24-May-02 22:55
Wang Huaizhi24-May-02 22:55 
GeneralWelcome Test it! Pin
marb24-May-02 22:49
marb24-May-02 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.