|
-
March 19th, 2012, 07:32 AM
#3
Re: Memory DC Help
 Originally Posted by krmed
From what I read in MSDN, the first two parameters for BitBlt should be the X and Y of the top left corner. Perhaps this is the problem?
Well, as you have pointed out, not only is it the top left corner, but it should be specified in "Logical Units". The width and height also need to be specified in logical units. I have tried every variation I could for the x and y but, I didn't convert the rect to logical units. That was the first mistake. The second is that I had to specify the height as negative. Haven't yet wrapped my head around this yet, but I suppose it is because I specify the 'Y' direction as positive in the 'UP' direction.
Code:
dc.DPtoLP(&rect);
dc.BitBlt(rect.left, rect.top, rect.Width(), -rect.Height(), &memDc, 0, 0, SRCCOPY);
Thanks, it works.
Mike
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
|