應該是沒有...我知道direct x有
--
[1;32m※ Origin: [33m明新技術學院 藍色國度 [37m<bbs.mhit.edu.tw> [m
[1;31m◆ From : [36m61-217-208-155.HINET-IP.hinet.net [m
有阿~~~但是mfc不提供,妳要自己時做出...
圖檔講解...03.bmp:底色是黑色(colorkey)再來上面就是要顯示的東西
03mask.bmp:底色是黑色(colorkey),要顯示得範圍則給它變為白色
就這樣...試試看吧
void CForm01View::ShowImage(CString str)
{
#ifndef _DEBUG
str.Delete(str.GetLength()-1,1);
#else
str="E:\\圖檔\\小圖檔\\03.bmp";
#endif
//
// 秀圖...............................................................
//
CPoint point;
point.x=70;
point.y=330;
// str.Delete(str.GetLength()-1,1);
HDC hdcMemImag;
HDC hdcMemMask;
hBitmapImag=(HBITMAP)LoadImage(NULL,str,IMAGE_BITMAP,0,0,
LR_LOADFROMFILE|LR_CREATEDIBSECTION);
// 判斷hBmp是否有圖形.
GetObject(
hBitmapImag,sizeof(BITMAP),&bitmap);
cxBitmap=bitmap.bmWidth;
cyBitmap=bitmap.bmHeight;
// 建立MemoryDC.
hdcMemImag=CreateCompatibleDC(NULL);
SelectObject(hdcMemImag,hBitmapImag);
// create the monochrome...
#ifndef _DEBUG
str.Delete(str.GetLength()-1,1);
#else
str="E:\\圖檔\\小圖檔\\03_MASK.bmp";
#endif
hBitmapMask=(HBITMAP)LoadImage(NULL,str,IMAGE_BITMAP,0,0,
LR_LOADFROMFILE|LR_CREATEDIBSECTION);
hdcMemMask=CreateCompatibleDC(NULL);
SelectObject(hdcMemMask,hBitmapMask);
// MASK the original image.
BitBlt(hdcMemImag,0,0,cxBitmap,cyBitmap,
hdcMemMask,0,0,SRCAND);
DeleteDC(hdcMemImag);
DeleteDC(hdcMemMask);
////////////////////////////////////////////////
//
hdcMemImag=CreateCompatibleDC(NULL);
SelectObject(hdcMemImag,hBitmapImag);
hdcMemMask=CreateCompatibleDC(NULL);
SelectObject(hdcMemMask,hBitmapMask);
CClientDC adc(this);
BitBlt(adc,point.x,point.y, // 50,150,
cxBitmap,cyBitmap,
hdcMemMask,0,0,0x220326);
BitBlt(adc,point.x,point.y, // 50,150,
cxBitmap,cyBitmap,
hdcMemImag,0,0,SRCPAINT);
DeleteDC(hdcMemImag);
DeleteDC(hdcMemMask);
DeleteObject(hBitmapMask);
DeleteObject(hBitmapImag);
}
--
[1;32m※ Origin: [33m大葉大學戀戀紅城 [37m<bbs.dyu.edu.tw> [m
[1;32m※ From : [36mswtc241-170.adsl.seed.net.tw [m