Click here to Skip to main content
15,925,133 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralTCHAR Strings and concatonation issues Pin
TomD227-Jan-04 23:53
TomD227-Jan-04 23:53 
GeneralRe: TCHAR Strings and concatonation issues Pin
Diddy28-Jan-04 0:47
Diddy28-Jan-04 0:47 
GeneralRe: TCHAR Strings and concatonation issues Pin
TomD228-Jan-04 3:25
TomD228-Jan-04 3:25 
GeneralRe: TCHAR Strings and concatonation issues Pin
Diddy28-Jan-04 6:01
Diddy28-Jan-04 6:01 
Generaldisplaying menu item in a status bar Pin
toxcct27-Jan-04 22:59
toxcct27-Jan-04 22:59 
GeneralRegistering DLL Pin
kevcs227-Jan-04 22:52
kevcs227-Jan-04 22:52 
GeneralCDC Pin
viliam27-Jan-04 22:14
viliam27-Jan-04 22:14 
GeneralRe: CDC Pin
Antti Keskinen28-Jan-04 1:59
Antti Keskinen28-Jan-04 1:59 
The fastest and most quickest option is pixel-wise copying:

1. Create a fresh, unselected bitmap object (CBitmap).
2. Get the dimensions of the DC.
3. Create the underlying Windows bitmap by using CreateBitmap member function. Remember to use DC's dimensions.
3. Achieve a pointer to the bitmap's data (See MSDN -> CBitmap)
4. Run through a for-loop, copying the color of each pixel from the DC into the bitmap's data matrix.

This is the easiest way, although if your color settings are strange, it may result WEIRD bitmaps. An alternative might be that you create a compatible DC, then select a blank bitmap into it, copy from source to destination, and then save the bitmap. This allows some control over color changes.

Alternatively, use some ready-made classes, such as CxImage, available from CodeProject.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: CDC Pin
Mike Dimmick28-Jan-04 2:15
Mike Dimmick28-Jan-04 2:15 
Generalmanaged c++ and licenses Pin
Roger Alsing27-Jan-04 21:38
Roger Alsing27-Jan-04 21:38 
GeneralGetting the Windows FontWidth Pin
Pazzuzu27-Jan-04 21:28
Pazzuzu27-Jan-04 21:28 
GeneralRe: Getting the Windows FontWidth Pin
Antti Keskinen27-Jan-04 21:46
Antti Keskinen27-Jan-04 21:46 
GeneralRe: Getting the Windows FontWidth Pin
Pazzuzu27-Jan-04 22:00
Pazzuzu27-Jan-04 22:00 
GeneralRe: Getting the Windows FontWidth Pin
Antti Keskinen28-Jan-04 1:39
Antti Keskinen28-Jan-04 1:39 
GeneralRe: Getting the Windows FontWidth Pin
Pazzuzu27-Jan-04 23:04
Pazzuzu27-Jan-04 23:04 
GeneralPaste gif, jpg images Pin
Filomela27-Jan-04 20:25
Filomela27-Jan-04 20:25 
GeneralRe: Paste gif, jpg images Pin
CodeBrain28-Jan-04 21:22
CodeBrain28-Jan-04 21:22 
GeneralRe: Paste gif, jpg images Pin
Filomela29-Jan-04 20:34
Filomela29-Jan-04 20:34 
GeneralRe: Paste gif, jpg images Pin
CodeBrain29-Jan-04 21:30
CodeBrain29-Jan-04 21:30 
GeneralRe: Paste gif, jpg images Pin
Filomela1-Feb-04 20:55
Filomela1-Feb-04 20:55 
GeneralRe: Paste gif, jpg images Pin
CodeBrain1-Feb-04 21:12
CodeBrain1-Feb-04 21:12 
GeneralRe: Paste gif, jpg images Pin
CodeBrain2-Feb-04 3:02
CodeBrain2-Feb-04 3:02 
GeneralRe: Paste gif, jpg images Pin
Filomela2-Feb-04 20:35
Filomela2-Feb-04 20:35 
GeneralRe: Paste gif, jpg images Pin
CodeBrain2-Feb-04 21:16
CodeBrain2-Feb-04 21:16 
GeneralRe: Paste gif, jpg images Pin
Filomela16-Feb-04 20:23
Filomela16-Feb-04 20:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.