How do I set a pixel on the screen?
A Pixel can be plotted in Palettized mode or RGB Mode in DirectX. The sample applications "Palette.Zip" shows how to create a palette and plot a 8-bit Pixel.It uses the following steps
/*Initialization */
a) Initialize DirectDrawObject, Set an 8-bit mode,
b) Set a cooperative level
c) Create Front and BackBuffer
d) Initialize a Palette array with Random values
e) Create our DirectDrawPalette Object with this array
f) Set this as the palette of BackBuffer
/*Drawing*/
h) Lock BackBuffer
i) Draw Pixels directly into BackBuffer
j) Unlock BackBuffer
/*Cleanup*/
k) Destroy the palette
l) Destroy the BackBuffer & FrontBuffer
m) Destroy the DirectDraw Object
The sample "Palette.Zip" shows how to plot a 16-bit pixel.
/*Initialization*/
a) Initialize DirectDrawObject, Set an 16-bit mode,
b) Set a cooperative level
c) Create Front and BackBuffer
d) Read the PixelFormat
/*Drawing*/
e) Lock BackBuffer
i) Draw 16-BitPixels directly into BackBuffer(The speed of plotting depends on whether the CurrentPitch is same as your DisplayMode Width)
j) Unlock BackBuffer
/*Cleanup*/
k) Destroy the BackBuffer & FrontBuffer
l) Destroy the DirectDraw Object
FAQ Menu
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
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.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.
SSH and SFTP support for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
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!
3 Months Free & No Setup Fees on ASP.NET 3.5/2.0 Hosting on Windows 2008/2003 Servers ? Click Here!
