Click here to Skip to main content
15,396,540 members
Articles / Desktop Programming / MFC
Posted 24 May 2002


67 bookmarked

Drawing with DirectDraw & GDI

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


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


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.


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


About the Author

China China
No Biography provided

Comments and Discussions

QuestionI can't build Pin
druscelli7-May-12 0:23
Memberdruscelli7-May-12 0:23 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey26-Feb-12 21:38
professionalManoj Kumar Choubey26-Feb-12 21:38 
QuestionHow to use this library for multiple display? Pin
apurv14612-Jan-12 0:20
Memberapurv14612-Jan-12 0:20 
GeneralScrooling support on Zomm In Pin
nix32119-Jul-06 8:29
Membernix32119-Jul-06 8:29 
GeneralMemory Increase Problem Pin
speedall7723-Apr-06 1:16
Memberspeedall7723-Apr-06 1:16 
GeneralRe: Memory Increase Problem Pin
speedall7723-Apr-06 2:50
Memberspeedall7723-Apr-06 2:50 
QuestionHow about embedded? Pin
Mark C. Malburg24-Oct-05 3:22
MemberMark C. Malburg24-Oct-05 3:22 
GeneralDraw Teeth Pin
wasseem8-Sep-05 6:54
Memberwasseem8-Sep-05 6:54 
Generalcompile error Pin
beavis7-Jul-05 20:54
Memberbeavis7-Jul-05 20:54 
GeneralOverlay modus Pin
helium6620-Aug-04 5:16
Memberhelium6620-Aug-04 5:16 
GeneralCan't get a correct color Pin
visualobeje3-Jul-04 4:12
Membervisualobeje3-Jul-04 4:12 
Generalhelp me directdraw quesions Pin
liqun1981@hotmail.com18-Apr-04 2:38
Memberliqun1981@hotmail.com18-Apr-04 2:38 
General"Memory leak" and solution Pin
yuanhonglinchina24-Mar-04 4:50
Memberyuanhonglinchina24-Mar-04 4:50 
GeneralRe: "Memory leak" and solution Pin
Andrew Nemtsev6-Mar-06 21:28
MemberAndrew Nemtsev6-Mar-06 21:28 
GeneralThanks a lot ! Pin
Jeffrey Zhou5-Mar-04 15:15
MemberJeffrey Zhou5-Mar-04 15:15 
GeneralRe: Thanks a lot ! Pin
mrskyok5-Mar-04 15:24
Membermrskyok5-Mar-04 15:24 
GeneralRe: Thanks a lot ! Pin
Jeffrey Zhou5-Mar-04 15:24
MemberJeffrey Zhou5-Mar-04 15:24 
Questionloading a JPEG image? Pin
petray9-Jan-04 7:56
Memberpetray9-Jan-04 7:56 
GeneralDirectX 9.0 Pin
Chang Sen22-Dec-03 21:05
MemberChang Sen22-Dec-03 21:05 
GeneralOne suggestion Pin
Jeremy Kimball9-Dec-03 7:13
MemberJeremy Kimball9-Dec-03 7:13 
GeneralDirectX vs GDI Pin
vistra6-Jul-03 22:46
Membervistra6-Jul-03 22:46 
GeneralIt's what i need to write code,thanks! Pin
ICanFly8-Jan-03 20:45
MemberICanFly8-Jan-03 20:45 
GeneralRe: It's what i need to write code,thanks! Pin
marb8-Jan-03 21:42
Membermarb8-Jan-03 21:42 
GeneralRe: It's what i need to write code,thanks! Pin
ICanFly9-Jan-03 1:56
MemberICanFly9-Jan-03 1:56 
GeneralPolyline and Polygon Pin
Paul Selormey1-Aug-02 15:48
MemberPaul Selormey1-Aug-02 15:48 

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.