1.http://www.ai86.cn/book/windows_programming/14.htm (位图操作)
2.http://blog.csdn.net/jkflyfox/archive/2008/03/10/2164964.aspx (wince中显示PNG BMP GIF)
3.SHLoadImageFile 使用
OnDraw 片段:
CBitmap bitmap;
bitmap.Attach(SHLoadImageFile(L//My Documents//test.gif));
BITMAP bmpInfo;
bitmap.GetBitmap(&bmpInfo);
CDC bitmapDC:
bitmpaDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = bitmpaDC.SelectObject(&bitmap);
pDC->BitBlt(0,0,bmpInfo.bmWidth,bmpInfo.Height,&bitmapDC,0,0,SRCCOPY);
bitmapDC.SelectObject(pOldBitmap);
bitmap.DeleteObject();
4.http://blog.chinaunix.net/u/8600/showart.php?id=422501(强烈推荐wince上图片显示)
5.MFC 中使用SHLoadImageResource
如果在MFC中如果采用SHLoadImageResource来装载bmp jpg png
必须要打开.rc文件
然后编辑
IDR_SETTINGS_LOGO GIF DISCARDABLE "res//settings_logo.png"
GIF DISCARDABLE 以前这里默认是 PNG 改过来就了 具体依据参考:http://msdn2.microsoft.com/en-us/library/bb416325.aspx Converts an image file in the resource file to a bitmap file. A resource image file should be coded in the resource file as follows (using BMP as an example): IDB_MYIMAGE_BMP GIF DISCARDABLE "MyImage.bmp". Note: Please note that the example resource line above correctly specifies GIF, even though the resource itself is actually a bitmap. GIF should be specified for all image resources, regardless of their format. Supplying any specifier other than GIF results in failure to load the image resource.
5.http://blog.csdn.net/91program/archive/2007/12/06/1920524.aspx (wince GIF动画显示)
6. Wince MFC中显示bmp位图。 在OnPaint中写以下代码:
void CXXXDlg::OnPaint() { CBitmap bmp; bmp.LoadBitmap(IDB_BACKGRD_PIC); CPaintDC dc(this); CDC mem; mem.CreateCompatibleDC(&dc); CBitmap* pOld=(CBitmap*)mem.SelectObject(&bmp); BITMAP bm; bmp.GetBitmap(&bm); //dc.BitBlt(0,0,bm.bmWidth,bm.bmHeight,&mem,0,0,SRCCOPY);//the same as origin dc.StretchBlt(0,0,bm.bmWidth/*m_canvasW*/,/*m_canvasH*/bm.bmHeight,&mem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY); mem.SelectObject(pOld); CDialog::OnPaint(); }
7. 透明位图的实现