insert bitmap on SDI
-
hello everyone i want to load a bitmap from file and insert in specific coordinate of my SDI program. but when i write codes and run program it shows nothing. ;P could i have a guide to using and inserting bitmap in my SDI. thanx
could you show your code?
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
-
could you show your code?
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )
CBitmap Bitmap;
CDC dcMem;
HBITMAP hBitmap = 0;
hBitmap = (HBITMAP)LoadImage( AfxGetInstanceHandle(),
strLocationOfBitmap,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE | LR_DEFAULTSIZE);dcMem.CreateCompatibleDC(pDC); Bitmap.CreateCompatibleBitmap(pDC, 390, -230); Bitmap.Attach( hBitmap ); dcMem.SelectObject(&Bitmap); pDC->BitBlt(1280, -1765, 390, -230, &dcMem, 0, 0, SRCCOPY);/\*pDC : on draw defined dc\*/
i used many codes delete and add some function to them. i never used GUI in VC++. :(
-
CBitmap Bitmap;
CDC dcMem;
HBITMAP hBitmap = 0;
hBitmap = (HBITMAP)LoadImage( AfxGetInstanceHandle(),
strLocationOfBitmap,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE | LR_DEFAULTSIZE);dcMem.CreateCompatibleDC(pDC); Bitmap.CreateCompatibleBitmap(pDC, 390, -230); Bitmap.Attach( hBitmap ); dcMem.SelectObject(&Bitmap); pDC->BitBlt(1280, -1765, 390, -230, &dcMem, 0, 0, SRCCOPY);/\*pDC : on draw defined dc\*/
i used many codes delete and add some function to them. i never used GUI in VC++. :(
And where is this code? 1/ It would make sense to only load the CBitmap once - in your constructor maybe? 2/ -1765 seems very high... Does it work with (0,0) ? Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
And where is this code? 1/ It would make sense to only load the CBitmap once - in your constructor maybe? 2/ -1765 seems very high... Does it work with (0,0) ? Iain.
I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[^]
-
Which event you use this code?
Of one Essence is the human race thus has Creation put the base One Limb impacted is sufficient For all Others to feel the Mace (Saadi )