Click here to Skip to main content
15,911,531 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: using Unicode with Win98 Pin
PJ Arends6-Apr-03 21:44
professionalPJ Arends6-Apr-03 21:44 
GeneralSOS- LNK2019 fatal error under win32 Pin
Reza Shademani6-Apr-03 20:42
Reza Shademani6-Apr-03 20:42 
Generalsimple problem with cursor movement Pin
mnjobes6-Apr-03 19:52
mnjobes6-Apr-03 19:52 
GeneralRe: simple problem with cursor movement Pin
mnjobes7-Apr-03 3:10
mnjobes7-Apr-03 3:10 
GeneralBmp resize Pin
SatyaDY6-Apr-03 19:14
SatyaDY6-Apr-03 19:14 
GeneralRe: Bmp resize Pin
J. Dunlap6-Apr-03 19:33
J. Dunlap6-Apr-03 19:33 
GeneralRe: Bmp resize Pin
SatyaDY6-Apr-03 19:49
SatyaDY6-Apr-03 19:49 
GeneralRe: Bmp resize Pin
J. Dunlap6-Apr-03 20:28
J. Dunlap6-Apr-03 20:28 
If you are wanting to resize the bitmap in C++, you create a new bitmap with the dimensions you want, and StretchBlt the contents of the old bitmap onto the new one. This is the simplest way. It doesn't lose too much quality, either.

'this is written in VB


Dim phBmp as long
Dim WorkDC as long

'WorkDC is the temp DC we use for the StretchBlt
'phBmp is the new resized bitmap
'IBmp is the BITMAPINFO of the old bitmap
'mvarhDC is the normal DC for our bitmap
'mvarhBmp is the old bitmap

'create the new DC
WorkDC = CreateCompatibleDC(hdc) 'assuming that hdc is a screen DC

'create the new bitmap
phBmp = CreateCompatibleBitmap(mvarhDC, mvarDocWidth, mvarDocHeight)

poldbmp = SelectObject(WorkDC, phBmp) 'select new bitmap into work DC

'copy the old bitmap to the new
StretchBlt WorkDC, 1, 1, IBmp.bmWidth, IBmp.bmHeight, mvarhDC, 1, 1,IBmp.bmWidth,IBmp.bmHeight, vbSrcCopy

SelectObject WorkDC, poldbmp 'put back old bitmap in work DC
SelectObject mvarhDC, phBmp   'select the new bitmap into our normal DC
DeleteObject mvarhBmp               'delete the old bitmap
DeleteDC WorkDC                        'destroy the temporary work DC



"Do unto others as you would have them do unto you." - Jesus

"An eye for an eye only makes the whole world blind." - Mahatma Gandhi







GeneralRe: Bmp resize Pin
SatyaDY6-Apr-03 22:34
SatyaDY6-Apr-03 22:34 
GeneralRe: Bmp resize Pin
J. Dunlap7-Apr-03 8:11
J. Dunlap7-Apr-03 8:11 
GeneralRe: Bmp resize Pin
SatyaDY7-Apr-03 21:59
SatyaDY7-Apr-03 21:59 
GeneralHot key Pin
rohit.dhamija6-Apr-03 19:08
rohit.dhamija6-Apr-03 19:08 
GeneralRe: Hot key Pin
Ravi Bhavnani6-Apr-03 19:12
professionalRavi Bhavnani6-Apr-03 19:12 
GeneralRe: Hot key Pin
rohit.dhamija6-Apr-03 19:35
rohit.dhamija6-Apr-03 19:35 
GeneralRe: Hot key Pin
J. Dunlap6-Apr-03 19:41
J. Dunlap6-Apr-03 19:41 
GeneralRe: Hot key Pin
Nish Nishant6-Apr-03 19:58
sitebuilderNish Nishant6-Apr-03 19:58 
Generalmfc support in win32 app Pin
r i s h a b h s6-Apr-03 18:50
r i s h a b h s6-Apr-03 18:50 
GeneralRe: mfc support in win32 app Pin
r i s h a b h s6-Apr-03 20:48
r i s h a b h s6-Apr-03 20:48 
GeneralRe: mfc support in win32 app Pin
Chris Richardson7-Apr-03 3:42
Chris Richardson7-Apr-03 3:42 
GeneralPlease Help me ! Thanks! Pin
dxhdxh6-Apr-03 17:57
dxhdxh6-Apr-03 17:57 
Generalsimple string concatenation question Pin
J.B.6-Apr-03 17:06
J.B.6-Apr-03 17:06 
GeneralRe: simple string concatenation question Pin
Nick Parker6-Apr-03 17:28
protectorNick Parker6-Apr-03 17:28 
GeneralRe: simple string concatenation question Pin
J.B.7-Apr-03 1:27
J.B.7-Apr-03 1:27 
GeneralRe: simple string concatenation question Pin
anju6-Apr-03 17:38
anju6-Apr-03 17:38 
GeneralRe: simple string concatenation question Pin
Michael Dunn6-Apr-03 17:56
sitebuilderMichael Dunn6-Apr-03 17:56 

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.