![]() |
[win32][gdi32] Copying HDC to another?
I've tried to do CreateCompatibleDC(source_device) but it contains a result the same height and size as source_device but every pixel as black. Any help?
:
const int SCREEN_WIDTH = GetSystemMetrics(SM_CXSCREEN) - 1;EDIT: I see I have to use BitBlt? If so, may I have an example? I have an inefficiency in understanding win32 argument names. |
Re: [win32][gdi32] Copying HDC to another?
You code seems to be setting the pixels in the screen device from the copy, I think it should be the other way around.
|
Re: [win32][gdi32] Copying HDC to another?
In your second line, you use
SM_CXSCREEN when it should be SM_CYSCREEN. I think The Dark found your main problem though. |
Re: [win32][gdi32] Copying HDC to another?
Quote:
@The Dark: My goal is to create a copy of the screen, and then reverse the screen from reversing the pixels on my copy. |
Re: [win32][gdi32] Copying HDC to another?
From the CreateCompatibleDC page:
Quote:
|
Re: [win32][gdi32] Copying HDC to another?
your link points to GetDC
edit: how would i set the newly created HBITMAP's pixels? |
Re: [win32][gdi32] Copying HDC to another?
Sorry. Here's the real link.
I believe you can do as you were doing after you call CreateCompatibleBitmap. Don't forget that you have to call it on screen_device and then call SelectObject. |
| All times are GMT -5. The time now is 4:24 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC