Kiyone
13th May 2004, 15:22
Maybe this is a newbish question, i started few days ago to play a bit with the Simple Samples from the SDK. What i wanted to do is draw a rectangle by using GDI functions instead of drawing it directly like its done in the Sample.
// dst = Avisynth PVideoFrame
dstp = dst->GetWritePtr();
// constant values for testing
HBITMAP hbitmap = CreateBitmap(720, 480, 1, 32, dstp);
//create a temporary dc in memory.
HDC pDC = ::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
HGDIOBJ TmpObj=SelectObject(TmpDC,hbitmap);
HDC dcBmp=CreateCompatibleDC(TmpDC);
// draw a filled rectangle
RECT pos;
SetRect(&pos, 1, 1, 34, 34);
FillRect(dcBmp, &pos, (HBRUSH) (COLOR_WINDOW+1));
SelectObject(dcBmp,TmpObj);
DeleteDC(dcBmp);
Compiled dll works just fine but without drawing anything to the destination frame, except of the source frame.
Any ideas what's wrong with the code or how i can achieve what i want to do?
// dst = Avisynth PVideoFrame
dstp = dst->GetWritePtr();
// constant values for testing
HBITMAP hbitmap = CreateBitmap(720, 480, 1, 32, dstp);
//create a temporary dc in memory.
HDC pDC = ::GetDC(0);
HDC TmpDC=CreateCompatibleDC(pDC);
HGDIOBJ TmpObj=SelectObject(TmpDC,hbitmap);
HDC dcBmp=CreateCompatibleDC(TmpDC);
// draw a filled rectangle
RECT pos;
SetRect(&pos, 1, 1, 34, 34);
FillRect(dcBmp, &pos, (HBRUSH) (COLOR_WINDOW+1));
SelectObject(dcBmp,TmpObj);
DeleteDC(dcBmp);
Compiled dll works just fine but without drawing anything to the destination frame, except of the source frame.
Any ideas what's wrong with the code or how i can achieve what i want to do?