Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Feb 22nd, 2008, 6:13 PM   #1
null_ptr0
12 years old
 
Join Date: Nov 2007
Posts: 94
Rep Power: 1 null_ptr0 is on a distinguished road
[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;
const int SCREEN_HEIGHT = GetSystemMetrics(SM_CXSCREEN) - 1;
...
    int x;
    HDC screen_device = GetDC(NULL);
    HDC copy = CreateCompatibleDC(screen_device);
    for (x = 0; x <= SCREEN_WIDTH; ++x) {
        for (int y = 0; y <= SCREEN_HEIGHT; ++y) {
            SetPixel(screen_device, x, y,  GetPixel(copy, SCREEN_WIDTH - x, y));
        }
    }
...

EDIT:
I see I have to use BitBlt? If so, may I have an example? I have an inefficiency in understanding win32 argument names.
null_ptr0 is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
more problems with copying from classes cwl157 Java 0 Sep 19th, 2007 4:17 PM
copying files rwm C++ 8 Apr 26th, 2007 2:39 AM
String to Morse Code - Copying from string to string Xenon C 29 Nov 10th, 2005 2:30 PM
Copying memory address values rsnd C++ 4 Jun 19th, 2005 7:41 AM
copying files first before deleting them harjit Visual Basic 1 May 15th, 2005 7:05 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC