显示ICON图标,如下:
static HICON hIcon = (HICON)::LoadImage( AfxGetInstanceHandle(), TEXT("1.ico"), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); CClientDC dc(this); dc.DrawIcon( 350,150,hIcon);
显示bmp位图,如下:
static HBITMAP hBitmap = (HBITMAP)::LoadImage( NULL, TEXT("1.bmp"), IMAGE_BITMAP, 50, 50, LR_DEFAULTCOLOR | LR_CREATEDIBSECTION | LR_LOADFROMFILE); CBitmap bmp; bmp.m_hObject = hBitmap; CDC memDC;//使用兼容位图DC memDC.CreateCompatibleDC(GetDC()); memDC.SelectObject(bmp); BITMAP bmpInfo; bmp.GetBitmap(&bmpInfo); bool ret = dc.BitBlt(350,200,bmpInfo.bmWidth,bmpInfo.bmHeight,&memDC,0,0,SRCCOPY); //透明位图 //dc.TransparentBlt(350,200,bmpInfo.bmWidth,bmpInfo.bmHeight,&memDC, //0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,RGB(255,255,255));
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。