CBitmap和HBITMAP的區別及相互轉換方法

2021-04-30 12:08:46 字數 675 閱讀 5098

cbitmap和hbitmap的區別及相互轉換方法 

2008-06-16 08:05:03

cbitmap和hbitmap的區別及相互轉換方法

hpen hpen,hpen2; 

cpen pen,pen2; 

pen.attach(hpen); 

hpen2 = (hpen)pen; 

cbitmap bmp; 

bmp.loadbitmap(idb_bitmap1); 

hbitmap hbm = (hbitmap)bmp; 

cbitmap bmp1; 

bmp1.attach(hbm);

hbitmap = cbitmap.m_hobject 

cbitmap* = cbitmap.fromhandle(hbitmap)

//已知hbitmap hbit; 

cbitmap cb; 

cb.fromhandle(hbit); 

//已知cbitmap cb; 

hbitmap hbit=(hbitmap)cb;

cbitmap bmp; 

hbitmap hbmp; 

相互轉換: 

hbmp=(hbitmap)bmp.getsafehandle(); 

bmp.attach(hbmp); 

HBITMAP和CBitmap的互相轉換

hbitmap hbmp 方法 cpp view plain copy cbitmap pbmp cbitmap fromhandle hbmp 方法 cpp view plain copy cbitmap bmp bmp.attach hbmp 方法 轉換出來的臨時cbitmap物件似乎並不是可靠...

CBitmap和HBITMAP的區別及相互轉換方法

hbitmap是bitmap的指標,msdn中 handle to a bitmap.typedef handle hbitmap cbitmap是mfc中封裝bitmap的類 msdn中 encapsulates 囊括 a windows graphics device inte ce gdi b...

Bitmap到CBitmap的轉換

bitmap tpbitmap new bitmap width,height,pixelformat24bpprgb hbitmap aaa1 bitmap bm tpbitmap gethbitmap color 0,0,0 aaa1 cbitmap pbm cbitmap fromhandle...