Click here to Skip to main content
15,907,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: any gdi guru can help me? Pin
Cristian Amarie28-Dec-06 23:26
Cristian Amarie28-Dec-06 23:26 
GeneralRe: any gdi guru can help me? Pin
OmarLodhi29-Dec-06 4:10
OmarLodhi29-Dec-06 4:10 
AnswerRe: any gdi guru can help me? Pin
Gary R. Wheeler29-Dec-06 6:01
Gary R. Wheeler29-Dec-06 6:01 
AnswerRe: any gdi guru can help me? Pin
Hamid_RT29-Dec-06 17:42
Hamid_RT29-Dec-06 17:42 
GeneralRe: any gdi guru can help me? Pin
OmarLodhi30-Dec-06 4:40
OmarLodhi30-Dec-06 4:40 
AnswerRe: any gdi guru can help me? Pin
Mark Salsbery30-Dec-06 8:38
Mark Salsbery30-Dec-06 8:38 
AnswerRe: any gdi guru can help me? Pin
Mark Salsbery30-Dec-06 10:05
Mark Salsbery30-Dec-06 10:05 
GeneralRe: any gdi guru can help me? Pin
OmarLodhi31-Dec-06 19:07
OmarLodhi31-Dec-06 19:07 
Hi,

Here is code that i use to create image.

file = fopen(m_csBkImagePath, "rb");
fseek(file, SEEK_END, SEEK_END);
nSize = ftell(file);

byBmp = new BYTE[nSize];
fseek(file, SEEK_SET, SEEK_SET);

memset(byBmp, 0, nSize);
fread(byBmp,nSize, 1, file);

BITMAPFILEHEADER bmfh;
memcpy(&bmfh, byBmp, sizeof(bmfh));
BITMAPINFOHEADER bmih;
memcpy(&bmih, byBmp + sizeof(bmfh), sizeof(bmih));

int nRet = m_bmpBackImage.CreateBitmap(bmih.biWidth, bmih.biHeight, bmih.biPlanes, bmih.biBitCount, NULL);

nRet = m_bmpBackImage.SetBitmapBits(bmih.biSizeImage, byBmp + bmfh.bfOffBits);
delete [] byBmp;



here is the drawing code that i use to draw the image.


dcMemBkImage.CreateCompatibleDC(pDC);
dcMemBkImage.SelectObject(&m_bmpBackImage);
GetObject(m_bmpBackImage,sizeof(bitmap),&bitmap);
pDC->BitBlt(m_nLeft, m_nTop, bitmap.bmWidth, bitmap.bmHeight, &dcMemBkImage, 0, 0, SRCCOPY);
dcMemBkImage.DeleteDC();


but nothing is displayed only white image.
is there any reference code i can see. no one has faced this type of problem before?


thanks for all people responses.
Omar Lodhi

GeneralRe: any gdi guru can help me? [modified] Pin
Mark Salsbery1-Jan-07 11:22
Mark Salsbery1-Jan-07 11:22 
GeneralRe: any gdi guru can help me? Pin
OmarLodhi2-Jan-07 14:59
OmarLodhi2-Jan-07 14:59 
NewsHiEdit V1.0.1.4 [modified] Pin
akyprian28-Dec-06 21:33
akyprian28-Dec-06 21:33 
QuestionAnd the question is? Pin
CPallini28-Dec-06 21:43
mveCPallini28-Dec-06 21:43 
AnswerRe: And the question is? Pin
akyprian28-Dec-06 21:50
akyprian28-Dec-06 21:50 
GeneralRe: And the question is? Pin
prasad_som28-Dec-06 22:22
prasad_som28-Dec-06 22:22 
GeneralRe: HiEdit V1.0.1.4 Pin
ThatsAlok28-Dec-06 23:00
ThatsAlok28-Dec-06 23:00 
GeneralRe: HiEdit V1.0.1.4 Pin
akyprian29-Dec-06 0:03
akyprian29-Dec-06 0:03 
GeneralRe: HiEdit V1.0.1.4 Pin
ThatsAlok29-Dec-06 0:46
ThatsAlok29-Dec-06 0:46 
GeneralRe: HiEdit V1.0.1.4 Pin
David Crow29-Dec-06 3:56
David Crow29-Dec-06 3:56 
GeneralRe: HiEdit V1.0.1.4 Pin
akyprian29-Dec-06 4:18
akyprian29-Dec-06 4:18 
GeneralRe: HiEdit V1.0.1.4 Pin
Hamid_RT29-Dec-06 17:32
Hamid_RT29-Dec-06 17:32 
GeneralRe: HiEdit V1.0.1.4 Pin
akyprian30-Dec-06 11:40
akyprian30-Dec-06 11:40 
GeneralRe: HiEdit V1.0.1.4 Pin
Hamid_RT31-Dec-06 3:22
Hamid_RT31-Dec-06 3:22 
GeneralNavigation Error Pin
Shouvik Das28-Dec-06 20:52
Shouvik Das28-Dec-06 20:52 
QuestionVERY URGENT HELP REQUIRED Pin
darkverdict28-Dec-06 20:17
darkverdict28-Dec-06 20:17 
AnswerRe: VERY URGENT HELP REQUIRED Pin
Shouvik Das28-Dec-06 20:47
Shouvik Das28-Dec-06 20: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.