Im using setpixel, but it dissapears every time something moves over it, is there a way to make it stay?
Printable View
Im using setpixel, but it dissapears every time something moves over it, is there a way to make it stay?
Call your drawing code everytime the application recieves a WM_PAINT message.
Z.
thanks that works.....but now It is setting pixels outside of my program!!!!!! :eek:
Code:case WM_PAINT:
HDC myDC = GetDC(ghWnd_Main);
COLORREF color = RGB(50,50,50); // Create the color green
color = RGB(255,255,255);
for(i=1; i<=200; i++) {
SetPixel(myDC,i,200,color); // Plot the pixel
}
return 0;
perhaps you validate the handle first?
PHP Code:case WM_PAINT:
if (hWnd == ghWnd_Main)
{
HDC myDC = GetDC(ghWnd_Main);
COLORREF color = RGB(50,50,50); // Create the color green
color = RGB(255,255,255);
for(i=1; i<=200; i++)
{
SetPixel(myDC,i,200,color); // Plot the pixel
}
}
return 0;