Can I paint on Qt widget by invoking win32 sdk api?
Can I paint on Qt widget by invoking win32 sdk api?
The code is below, it seems that do not work.
I want to implement such function for some special aim.
Code:
PAINTSTRUCT ps;
HWND hwnd = (HWND)winId();
HDC hdc = BeginPaint(hwnd,&ps);
::MoveToEx(hdc, 0, 0, NULL);
bool stat = ::LineTo(hdc, 500, 500);
EndPaint(hwnd,&ps);
The codes are all in function paintEvent.
Re: Can I paint on Qt widget by invoking win32 sdk api?
I'm not sure but think this is possible. If I remember correctly I once drew using X libs on Linux (not sure even about the Qt version I used then), so likewise this might also be possible on Windows. Where is the referred code placed in the class and are you sure it didn't work{Ok, got it now}, I meant Qt might have drawn something on it afterwards.
Re: Can I paint on Qt widget by invoking win32 sdk api?
Quote:
Originally Posted by
yogeshm02
I'm not sure but think this is possible. If I remember correctly I once drew using X libs on Linux (not sure even about the Qt version I used then), so likewise this might also be possible on Windows. Where is the referred code placed in the class and are you sure it didn't work{Ok, got it now}, I meant Qt might have drawn something on it afterwards.
The codes are placed in function paintEvent.