How do I display a picture?

To display a picture (Bitmap format) using DirectDraw follow the following steps.

/*Initialization*/
a) Initialize DirectDraw

  1. Create a DirectDraw Object
  2. Query the interface for a DirectDraw7 Object using the DirectDraw object
  3. Set the Cooperative Level (In the sample "DirectDraw.zip" we have set the cooperative level as Exclusive and FullScreen)
  4. Set the DisplayMode
  5. Create the FrontBuffer using the DDSURFACEDESC2 structure
  6. Create a BackBuffer using DDSCAPS2 structure and attach it to the FrontBuffer
b) Load the Bitmap into a DirectDraw Surface

/*Drawing*/
c) Clear the BackBuffer and draw the DirectDraw Surface into the BackBuffer d) Flip the Back and Front Buffers at vertical Synchronization time of the Monitor (To avoid flickering of monitor)

/*Cleanup*/
e) Release the DirectDraw Surface, Back buffer, Front Buffer and the DirectDraw Object

FAQ Menu

 
Printer friendly version of the FAQ-DIRECTX-Display-Picture page


Sponsored links

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Villanova University Six Sigma & IT Certificate Programs
100% Online programs in Six Sigma, IS Security, CISSP Prep, Business Analysis, Proj. Mgmt. and more!
3 Months Free - ASP.NET Web Hosting
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application

Advertisement



Free Magazine

Free Magazines
eWeek The essential technology information source for builders of e-business.... subscribe now

Newsletter | Submit Content | About | Advertising | Awards | Contact Us | Link to us |
© 1996-2008 Community Networks Ltd All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Synchron Data - .NET development.