ok, i am a newb at drwing in win32 and i did look through the forum for this but didnt really know how to say it so here goes:
i want to be able to have the user click a button that i create and have it draw using setpixel the stuff that i have set up for it but when it do it like this
Code:
case WM_PAINT:
{
hdc = BeginPaint(hwnd,&ps);
for(j=0;j<256;j++)
{
for(k=0;k<256;k++)
{
SetPixel(hdc,j,k,RGB(0,j,k));
}
}
Arc(hdc,100,100,200,200,100,130,100,130);
EndPaint(hwnd,&ps);
break;
}
case WM_COMMAND:
{
switch(LOWORD(wParam))
{
case IDC_BUTTON_IMAGE1:
{
for(j=0;j<256;j++)
{
for(k=0;k<256;k++)
{
SetPixel(hdc,256+j,256+k,RGB(0,j,k));
}
}
Arc(hdc,200,200,300,300,100,100,200,200);
break;
}
}
break;
}
only the first part goes, the second part i just get a warning saying
Code:
C:\Documents and Settings\me\Desktop\drawing example\main.cpp(108) : warning C4700: local variable 'hdc' used without having been initialized
I know that i am doing something completely wrong but i do not know what it is?
any help? am i totally lost? i looked in a bunch of tutorials but i couldnt seem to find any help in them...and i dont have the cash to lay out for the book by charles petzold that goes through all the api stuff
any thought?