Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Minimize Mainframe in SDI Pin
Amin.Abdi25-Aug-09 21:36
Amin.Abdi25-Aug-09 21:36 
QuestionRe: Minimize Mainframe in SDI Pin
kiranin25-Aug-09 21:56
kiranin25-Aug-09 21:56 
AnswerRe: Minimize Mainframe in SDI Pin
Rajesh R Subramanian25-Aug-09 21:58
professionalRajesh R Subramanian25-Aug-09 21:58 
AnswerRe: Minimize Mainframe in SDI Pin
Rajesh R Subramanian25-Aug-09 21:57
professionalRajesh R Subramanian25-Aug-09 21:57 
GeneralRe: Minimize Mainframe in SDI Pin
kiranin25-Aug-09 22:11
kiranin25-Aug-09 22:11 
QuestionRe: Minimize Mainframe in SDI Pin
Amin.Abdi25-Aug-09 22:43
Amin.Abdi25-Aug-09 22:43 
AnswerRe: Minimize Mainframe in SDI Pin
kiranin25-Aug-09 23:32
kiranin25-Aug-09 23:32 
QuestionLoad Bitmap from file to doc Pin
Amin.Abdi25-Aug-09 21:13
Amin.Abdi25-Aug-09 21:13 
HBITMAP hBitmap = 0;
hBitmap = (HBITMAP)LoadImage( NULL,
    pDoc->cInfo.strContractBrand, //file location
    IMAGE_BITMAP,
    0,
    0,
    LR_LOADFROMFILE | LR_DEFAULTSIZE);
CBitmap Bitmap;
Bitmap.Attach( hBitmap );

BITMAP BitmapInfo = { 0 };
Bitmap.GetBitmap( &BitmapInfo );

DWORD BitmapImageSize = BitmapInfo.bmHeight *
    BitmapInfo.bmWidth *
    ( BitmapInfo.bmBitsPixel / 8 );

BYTE* pBitmapData = new BYTE[ BitmapImageSize ];
ZeroMemory( pBitmapData, BitmapImageSize );

Bitmap.SetBitmapBits(BitmapImageSize, pBitmapData);

Bitmap.SetBitmapBits( BitmapImageSize, pBitmapData );

pDC->SelectObject(&Bitmap);
pDC->BitBlt(1280, -1765, 390,  -230, pDC, // pDC : a CDC pointer to document (SDI Program)
0, 0, SRCCOPY);

delete pBitmapData;
pBitmapData = 0;

purpose:
i want to load a bitmap from file and insert in document. the file location is in C..Doc and PDoc is pointer to its document.
MapMode is MM_LOMETRIC.
problem:
it dosen't show anything.Mad | :mad: Confused | :confused:
i don't see anything in desired coordinate and print blank page.

notice:
i find these codes in web and didn't work with CBitmap class.
even didn't use bitmap in my programs.
AnswerRe: Load Bitmap from file to doc Pin
Cedric Moonen25-Aug-09 21:32
Cedric Moonen25-Aug-09 21:32 
GeneralRe: Load Bitmap from file to doc Pin
Amin.Abdi25-Aug-09 21:43
Amin.Abdi25-Aug-09 21:43 
QuestionRe: Load Bitmap from file to doc Pin
CPallini25-Aug-09 21:33
mveCPallini25-Aug-09 21:33 
AnswerRe: Load Bitmap from file to doc Pin
Amin.Abdi25-Aug-09 21:49
Amin.Abdi25-Aug-09 21:49 
QuestionRe: Load Bitmap from file to doc Pin
CPallini25-Aug-09 21:55
mveCPallini25-Aug-09 21:55 
AnswerRe: Load Bitmap from file to doc [modified] Pin
Amin.Abdi25-Aug-09 22:10
Amin.Abdi25-Aug-09 22:10 
QuestionRe: Load Bitmap from file to doc Pin
CPallini25-Aug-09 22:57
mveCPallini25-Aug-09 22:57 
AnswerRe: Load Bitmap from file to doc Pin
Amin.Abdi26-Aug-09 0:12
Amin.Abdi26-Aug-09 0:12 
GeneralRe: Load Bitmap from file to doc Pin
CPallini26-Aug-09 2:08
mveCPallini26-Aug-09 2:08 
GeneralRe: Load Bitmap from file to doc Pin
Amin.Abdi26-Aug-09 2:21
Amin.Abdi26-Aug-09 2:21 
GeneralRe: Load Bitmap from file to doc Pin
CPallini26-Aug-09 2:38
mveCPallini26-Aug-09 2:38 
GeneralRe: Load Bitmap from file to doc Pin
Amin.Abdi26-Aug-09 2:48
Amin.Abdi26-Aug-09 2:48 
GeneralRe: Load Bitmap from file to doc Pin
CPallini26-Aug-09 2:55
mveCPallini26-Aug-09 2:55 
QuestionDate and Time Pin
john563225-Aug-09 20:00
john563225-Aug-09 20:00 
AnswerRe: Date and Time Pin
Rajesh R Subramanian25-Aug-09 20:16
professionalRajesh R Subramanian25-Aug-09 20:16 
AnswerRe: Date and Time Pin
Cedric Moonen25-Aug-09 20:20
Cedric Moonen25-Aug-09 20:20 
QuestiondwDesiredAccess in CreateFile API Pin
Varghese Paul M25-Aug-09 18:47
Varghese Paul M25-Aug-09 18:47 

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.