Advertisement

Pixel plotting

Started by February 15, 2002 11:02 AM
2 comments, last by ank2 22 years, 10 months ago
I have been learning the basics of windows programming for a while now and would now like to learn a bit about GDI, such as plotting pixels on screen. So can anyone please give me an idea on how to create a simple function that plots a pixel, somthing like - Pixel(x, y, color, hwnd); This is probably overly simple, but it looks like a good way. Thanks for your time.
Group Who
Sounds like you are looking for the SetPixel() function:

COLORREF SetPixel(
HDC hdc, // handle to DC
int X, // x-coordinate of pixel
int Y, // y-coordinate of pixel
COLORREF crColor // pixel color
);

Is that what you wanted?

--
Very simple ideas lie within the reach only of complex minds.
Advertisement
this is sort of a sub question... Is there a function for doing this in OpenGl? I tryed to use this with OpenGL but it just flickers

Ben Gosney.
Please excuse my grammer, I'm from zomerzet
Two questions -

1) How do you specify the color in crColor.
2) Do you use this function in the WM_PAINT message?
Group Who

This topic is closed to new replies.

Advertisement