关闭

图片淡出效果

408人阅读 评论(0) 收藏 举报
void CCellWallMainFrameListBox::RefreshSelectAd(CWindowGc& gc,CFbsBitmap *imgToBrighten) const
{


CFbsBitmap* iEmptyBitmap = new ( ELeave ) CFbsBitmap();
CleanupStack::PushL( iEmptyBitmap );

User::LeaveIfError( iEmptyBitmap->Create( imgToBrighten->SizeInPixels(), CEikonEnv::Static()->DefaultDisplayMode() ) );

CFbsBitmapDevice *iGD = CFbsBitmapDevice::NewL( iEmptyBitmap );
CleanupStack::PushL( iGD );
CFbsBitGc *iGC;
User::LeaveIfError( iGD->CreateContext( iGC ) );

iGC->SetPenStyle( CGraphicsContext::ENullPen );
TRgb aColor(255,255,128);
iGC->SetBrushColor( aColor );
iGC->SetBrushStyle( CGraphicsContext::ESolidBrush );
iGC->DrawRect( TRect(TPoint(0,0), iEmptyBitmap->SizeInPixels()) );
iGC->SetBrushStyle( CGraphicsContext::ENullBrush );

delete iGC;
CleanupStack::PopAndDestroy( iGD );

TRect rc(Rect());
TRect rect;
if ((50 == version) || (52 == version))
{
rect.SetRect(TPoint(rc.iTl.iX, rc.iBr.iY-45),TPoint(rc.iBr.iX, rc.iBr.iY));
}
else
{
rect.SetRect(TPoint(rc.iTl.iX, rc.iBr.iY-30),TPoint(rc.iBr.iX, rc.iBr.iY));
}
gc.DrawBitmapMasked(rect,imgToBrighten,TRect(TPoint(0,0),iEmptyBitmap->SizeInPixels()),iEmptyBitmap,EFalse);

CleanupStack::PopAndDestroy( iEmptyBitmap );


}
这段代码实现图片变淡,你可以通过调整TRgb aColor(255,255,128);这里的颜色值来观察图片的显示效果
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:225188次
    • 积分:2826
    • 等级:
    • 排名:第12658名
    • 原创:44篇
    • 转载:106篇
    • 译文:1篇
    • 评论:21条
    文章分类
    最新评论