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

C / C++ / MFC

 
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 
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 
Sorry about that - wouldn't have been able to help you last night otherwise, beacuase I didn't have time to port it to C++. But here it is!

//this is written in C++ [:D]
<br>
HBITMAP phBmp;
HDC WorkDC;
//
//WorkDC is the temp DC we use for the StretchBlt
//phBmp is the new resized bitmap
//IBmp is the BITMAPINFO of the new bitmap
//mvarhDC is the normal DC for our bitmap
//mvarhBmp is the old bitmap
//Bmp  is the BITMAPINFO of 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,Bmp->bmWidth,Bmp->bmHeight, SRCCOPY);
//
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
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 
GeneralRe: simple string concatenation question Pin
J.B.6-Apr-03 18:40
J.B.6-Apr-03 18:40 
GeneralRe: simple string concatenation question Pin
Anders Molin7-Apr-03 0:09
professionalAnders Molin7-Apr-03 0:09 

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.