透明图片问题! 怎么用网上找的个类
zhp21 2006-07-25 08:59:28 bool CUserInfoCtrl::addPicture(CString astrpathName)
{
if( astrpathName.IsEmpty() != true)
{
CRect lRect;
mptStaticPicture->GetWindowRect(&lRect);//mptStaticPicture 创建的这个控件的指针
HBITMAP lhBitmap = (HBITMAP)LoadImage(NULL,astrpathName, IMAGE_BITMAP,lRect.Width(),lRect.Height(), LR_LOADFROMFILE);
////mptStaticPicture->SetBitmap(lhBitmap); 用这不用后面的可出来没透明的图片
CPaintDC lpdc(mptStaticPicture);// mpParentWnd 传过来的个CWnd 指针
DrawTransparentBmp(lpdc.m_hDC,lhBitmap,lRect,RGB(0x00,0x00,0xff));
return true;
}
else
{
return false;
}
}
// 就是不出来,怎么回事情? HBITMAP lhBitmap 为了在磁盘里面读图片,不用CBitmap
DrawTransparentBmp函数在下一帖子