GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 24-Apr-2009, 04:30
uwi2k2 uwi2k2 is offline
New Member
 
Join Date: Apr 2009
Posts: 1
uwi2k2 is on a distinguished road

Copy window DC for later use in offscreen DC


hi all,

first, i am german so my english might not be best. sorry for that.

for my small gdi 2d game i like to have a offscreen DC to draw in
but mostly to save a copy of the window DC ( the visible one ).

here comes a short scratch of what i am trying to do
...

CPP / C++ / C Code:
// !! used variables are all declared allredy !!
// get handel to window DC
handel = GetDC( hwnd );
// make offscreen DC and comp. bitmap in it
BackBuffer = CreateCompatibleDC( handel );
BackBit     = CreateCompatibleBitmap( BackBuffer ,500 , 500  );

... load and blit some *.bmp files to window DC ( handel )

// TIMEPOINT A : blit window DC to offscreen DC ( with all the *.bmp stuff in it )
BitBlt( BackBuffer , 0 ,0 ,500 ,500 ,handel ,0 ,0 ,SRCCOPY );

... go on with drawing in the window DC ( handel )

// blit the old status from TIMEPOINT A  from the  backbuffer DC back to Window DC 
BitBlt( handel , 0 , 0 , 500, 500, BackBuffer, 0 , 0 , SRCCOPY);

i hope you understand what i am trying to do:
i´d like to save a copy of alle the stuff drawn and loaded to the window DC in a offscreen DC to gat it back on the screen later.
sadly it does not work, drawn objects like rectangles are copyed to the backbuffer but loaded and blited *.bmp´s are not, they are somehow ignored.

hopefully you can tell me what is wrong, or how it works.

thanks ...
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB 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
Traditional Win32 programming vs. wxWidgets Zorachus C++ Forum 2 10-Feb-2007 18:54
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 15:46
How to minimize a application to the system tray? Thomas555 C++ Forum 12 20-May-2005 14:35
Win32 Window Shading behavior (like linux) WillyumYum C++ Forum 3 18-Apr-2005 15:36
Changing window start colour Rosdahale C++ Forum 5 19-Jan-2005 16:51

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:22.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.