|
-
Jul 18th, 2001, 12:54 PM
#1
Thread Starter
Frenzied Member
Keeping stuff on the screen
Im using setpixel, but it dissapears every time something moves over it, is there a way to make it stay?
-
Jul 18th, 2001, 12:59 PM
#2
Call your drawing code everytime the application recieves a WM_PAINT message.
Z.
-
Jul 18th, 2001, 01:37 PM
#3
Thread Starter
Frenzied Member
thanks that works.....but now It is setting pixels outside of my program!!!!!!
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;
-
Jul 22nd, 2001, 11:58 PM
#4
PowerPoster
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;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|