1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
case WM_PAINT:
{
if (inst->Paint==NULL) break;
PAINTSTRUCT ps;
HDC hdcimage = CreateCompatibleDC(NULL);
int width=ps.rcPaint.right-ps.rcPaint.left;
int height =ps.rcPaint.bottom-ps.rcPaint.top;
HBITMAP hbitmap=CreateCompatibleBitmap(hdcimage,width,height);
int f=width;// GetLastError();
SelectObject(hdcimage, hbitmap);
//int f= GetLastError();
FillRect(hdcimage,&ps.rcPaint,CreateSolidBrush(inst->clrBackColor));
inst->Paint(inst->hwnd,hdcimage);
HDC hdc = BeginPaint(inst->hwnd, &ps);
BitBlt(ps.hdc,0,0,ps.rcPaint.right-ps.rcPaint.left,ps.rcPaint.bottom-ps.rcPaint.top,hdcimage,0,0,SRCCOPY);
MessageBox(NULL,to_string(f).c_str(),"erro",MB_OK);
EndPaint(inst->hwnd, &ps);
DeleteObject(hbitmap);
DeleteDC(hdcimage);
}
break;
| |