本文整理汇总了C++中CFbsBitGc::Activate方法的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitGc::Activate方法的具体用法?C++ CFbsBitGc::Activate怎么用?C++ CFbsBitGc::Activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFbsBitGc
的用法示例。
在下文中一共展示了CFbsBitGc::Activate方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CompareScreenContentWithTestBitmapL
TBool CTestContainer::CompareScreenContentWithTestBitmapL(const CBitmapFrameData& aBkgdFrame, const CBitmapFrameData& aFrame1, const TPoint& aPos)
{
TSize size = aFrame1.Bitmap()->SizeInPixels();
// Create test bitmap for comparison
CFbsBitmap* testBitmap = new (ELeave) CFbsBitmap;
CleanupStack::PushL(testBitmap);
User::LeaveIfError( testBitmap->Create(size, iEikonEnv->DefaultDisplayMode()));
CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(testBitmap);
CleanupStack::PushL(bitmapDevice);
CFbsBitGc* bitmapGc = CFbsBitGc::NewL();
CleanupStack::PushL(bitmapGc);
bitmapGc->Activate(bitmapDevice);
// Blit the background bitmap
bitmapGc->BitBlt(aPos, aBkgdFrame.Bitmap());
// Blit the frame bitmap with mask
bitmapGc->BitBltMasked(aPos, aFrame1.Bitmap(), size, aFrame1.Mask(), ETrue);
// Create bitmap and blit the screen contents into it for comparing it with test bitmap created above
TRect rect(aPos,size);
CFbsBitmap* scrBitmap = new (ELeave) CFbsBitmap;
CleanupStack::PushL(scrBitmap);
User::LeaveIfError(scrBitmap->Create(size, iEikonEnv->DefaultDisplayMode()) );
User::LeaveIfError( iEikonEnv->ScreenDevice()->CopyScreenToBitmap(scrBitmap,rect) );
TBool ret=CompareBitmapsL(testBitmap,scrBitmap);
CleanupStack::PopAndDestroy(4); //scrBitmap, bitmapGc, bitmapDevice, testBitmap
return ret;
}
示例2: DrawChoiceListBackground
// CFepLayoutChoiceList::DrawChoiceListBackground
// Draw choice list background.
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//
void CFepLayoutChoiceList::DrawChoiceListBackground(const TRect& aRect)//, TBool aDrawBorder)
{
if( iBackgroundSkinID.iMajor != EAknsMajorNone &&
iBackgroundSkinID.iMinor != EAknsMinorNone )
{
//draw bitmap
DrawOpaqueMaskBackground( aRect );
TRect rtInnerRect( aRect );
rtInnerRect.Shrink( 1, 1 );
CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
gc->Activate( BitmapDevice() );
AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(),
*gc,
aRect,
rtInnerRect,
iBackgroundSkinID,
KAknsIIDDefault );
}
else
{
//draw bitmap
DrawOpaqueMaskBackground();
//front bitmaps-------
DrawBackground();
}
}
示例3: ConstructL
void CEmTubeSplashViewContainer::ConstructL(const TRect& aRect)
{
iAlpha = KAlphaMax;
iAppUi = STATIC_CAST(CEmTubeAppUi*, CEikonEnv::Static()->EikAppUi());
CreateWindowL();
TSize size( KBitmapSize, KBitmapSize );
CFbsBitmap *bmp = AknIconUtils::CreateIconL( KBitmapFileName, EMbmOpenvideohubLogo_white );
CleanupStack::PushL( bmp );
AknIconUtils::SetSize( bmp, size );
iBitmap = new (ELeave) CFbsBitmap();
iBitmap->Create( size, EColor16MU );
CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL( iBitmap );
CleanupStack::PushL( bitmapDevice );
CFbsBitGc* bitmapGc = CFbsBitGc::NewL();
CleanupStack::PushL( bitmapGc );
bitmapGc->Activate( bitmapDevice );
bitmapGc->DrawBitmap( size, bmp );
CleanupStack::PopAndDestroy( bitmapGc );
CleanupStack::PopAndDestroy( bitmapDevice );
CleanupStack::PopAndDestroy( bmp );
iTmpBitmap = new (ELeave) CFbsBitmap;
iTmpBitmap->Create( TSize(KBitmapSize, KBitmapSize), EColor16MU );
SetRect(aRect);
iClientRect = aRect;
ActivateL();
SetExtentToWholeScreen();
iAppUi->StopDisplayingPopupToolbar();
iFadeTimer = CEmTubeTimeOutTimer::NewL( *this );
iFadeTimer->After( KFadePeriod, ECommandFadeIn );
iTimer = CEmTubeTimeOutTimer::NewL( *this );
iTimer->After( KSplashTime, ECommandFinish );
#ifdef __S60_50__
MTouchFeedback* feedback = MTouchFeedback::Instance();
if ( feedback )
{
feedback->EnableFeedbackForControl( this, ETrue );
}
#endif
}
示例4: TileInBitmapRect
// -----------------------------------------------------------------------------
// CMaskedBitmap::TileInBitmapRect
// -----------------------------------------------------------------------------
void CMaskedBitmap::TileInBitmapRect( CFbsBitGc& gc, const TRect& bmpRect, const TPoint& srcPt )
{
if (!HasMask())
{
TRAP_IGNORE(
CFbsBitGc* copy = CFbsBitGc::NewL();
CleanupStack::PushL( copy );
copy->Activate( (CFbsDevice*) gc.Device() );
copy->CopySettings( gc );
copy->UseBrushPattern(iBitmap);
copy->SetPenStyle(CGraphicsContext::ENullPen);
copy->SetBrushStyle(CGraphicsContext::EPatternedBrush);
copy->SetBrushOrigin(srcPt);
copy->DrawRect(bmpRect);
copy->DiscardBrushPattern();
CleanupStack::PopAndDestroy( copy );
);
示例5: CopyBitmapL
class CFbsBitmap* WFBitmapUtil::CopyBitmapL(class CFbsBitmap* aBitmap)
{
if (!aBitmap) {
return NULL;
}
class CFbsBitmap* copiedBitmap = new (ELeave) CFbsBitmap();
copiedBitmap->Create(aBitmap->SizeInPixels(), aBitmap->DisplayMode());
CFbsBitmapDevice* fbsdev = CFbsBitmapDevice::NewL(copiedBitmap);
CleanupStack::PushL(fbsdev);
CFbsBitGc* fbsgc = CFbsBitGc::NewL();
CleanupStack::PushL(fbsgc);
fbsgc->Activate(fbsdev);
fbsgc->BitBlt(TPoint(0,0),aBitmap);
CleanupStack::PopAndDestroy(2);
return copiedBitmap;
}
示例6: CreateIfNeededL
// -----------------------------------------------------------------------------
// CAknsAlEffectContext::CreateIfNeededL
// -----------------------------------------------------------------------------
//
void CAknsAlEffectContext::CreateIfNeededL( const TInt aLayerIndex,
const TInt aLayerStatus, const TBool aInitialize )
{
if( ( aLayerIndex < 0 ) || ( aLayerIndex >= KAknsAlEffectContextLayerN ) )
{
User::Leave( KAknsRlErrBadLayerIndex );
}
/*lint -save -e661 */ // Index is boundary checked above
if( iLayers[aLayerIndex].iRGBBitmap &&
iLayers[aLayerIndex].iAlphaBitmap ) return;
if( iLayers[aLayerIndex].iRGBBitmap ||
iLayers[aLayerIndex].iAlphaBitmap )
User::Leave( KAknsRlErrInternalState );
TSize size = LayerSize();
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
CleanupStack::PushL( bitmap );
User::LeaveIfError( bitmap->Create( size, iRgbMode ) );
CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( bitmap );
CleanupStack::PushL( dev );
CFbsBitGc* gc = CFbsBitGc::NewL();
CleanupStack::PushL( gc );
gc->Activate( dev );
iLayers[aLayerIndex].iRGBBitmap = bitmap;
iLayers[aLayerIndex].iRGBDevice = dev;
iLayers[aLayerIndex].iRGBGc = gc;
CleanupStack::Pop(3); // gc, dev, bitmap
bitmap = new (ELeave) CFbsBitmap();
CleanupStack::PushL( bitmap );
User::LeaveIfError( bitmap->Create( size, EGray256 ) );
dev = CFbsBitmapDevice::NewL( bitmap );
CleanupStack::PushL( dev );
gc = CFbsBitGc::NewL();
CleanupStack::PushL( gc );
gc->Activate( dev );
iLayers[aLayerIndex].iAlphaBitmap = bitmap;
iLayers[aLayerIndex].iAlphaDevice = dev;
iLayers[aLayerIndex].iAlphaGc = gc;
CleanupStack::Pop(3); // gc, dev, bitmap
if( aInitialize )
{
switch( aLayerStatus )
{
case KAknsRlLayerRGBOnly:
iLayers[aLayerIndex].iRGBGc->SetBrushColor( KRgbBlack );
iLayers[aLayerIndex].iRGBGc->Clear();
iLayers[aLayerIndex].iAlphaGc->SetBrushColor( KRgbWhite );
iLayers[aLayerIndex].iAlphaGc->Clear();
break;
default:
iLayers[aLayerIndex].iRGBGc->SetBrushColor( KRgbBlack );
iLayers[aLayerIndex].iRGBGc->Clear();
iLayers[aLayerIndex].iAlphaGc->SetBrushColor( KRgbBlack );
iLayers[aLayerIndex].iAlphaGc->Clear();
break;
}
}
/*lint -restore */
}//lint !e661 Layer index is boundary checked
示例7: CreatePopupBitmapL
// ---------------------------------------------------------------------------
// CAknDiscreetPopupDrawer::CreatePopupBitmap
// ---------------------------------------------------------------------------
//
void CAknDiscreetPopupDrawer::CreatePopupBitmapL( const TRect& aRect )
{
delete iPopupBitmap;
iPopupBitmap = NULL;
// create a bitmap to draw to
CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap;
CleanupStack::PushL( bitmap );
bitmap->Create(
aRect.Size(), CCoeEnv::Static()->ScreenDevice()->DisplayMode() );
CFbsBitGc* fbsBitGc = CFbsBitGc::NewL();
CleanupStack::PushL( fbsBitGc );
CFbsBitmapDevice* bmpDevice = CFbsBitmapDevice::NewL( bitmap );
CleanupStack::PushL( bmpDevice );
fbsBitGc->Activate( bmpDevice );
// draw background of the popup
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
AknsDrawUtils::DrawFrame( skin, *fbsBitGc, aRect, aRect,
KAknsIIDQsnFrPopupPreview, KAknsIIDDefault, KAknsDrawParamDefault );
// Draw the texts
TRgb textColor( EikonEnv()->ControlColor( EColorControlText, *iControl ) );
if ( iAction )
{
fbsBitGc->SetUnderlineStyle( EUnderlineOn );
AknsUtils::GetCachedColor( skin,
textColor,
KAknsIIDQsnHighlightColors,
EAknsCIQsnHighlightColorsCG3 );
}
else
{
AknsUtils::GetCachedColor( skin,
textColor,
KAknsIIDQsnTextColors,
EAknsCIQsnTextColorsCG55 );
}
fbsBitGc->SetPenColor( textColor );
DrawTexts( fbsBitGc );
fbsBitGc->SetUnderlineStyle( EUnderlineOff );
// draw the icon
if ( iIcon && iIcon->Bitmap() && iIcon->Mask() )
{
fbsBitGc->BitBltMasked( iIconRect.iTl,
iIcon->Bitmap(),
iIcon->Bitmap()->SizeInPixels(),
iIcon->Mask(),
EFalse );
}
else if( iIcon && iIcon->Bitmap() )
{
fbsBitGc->BitBlt( iIconRect.iTl, iIcon->Bitmap() );
}
CleanupStack::PopAndDestroy( bmpDevice );
CleanupStack::PopAndDestroy( fbsBitGc );
CleanupStack::Pop( bitmap );
iPopupBitmap = bitmap;
}
示例8: Draw
EXPORT_C void CBubbleCtrl::Draw()
{
if(!AbleToDraw() || iFreeze ) //|| !iShowing )
{
return;
}
CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
//mask bitmaps
DrawOpaqueMaskBackground();
TRect rect = Rect();
TRect innerRect = rect;
if ( ( iLeftDiff == 0 ) && ( iTopDiff == 0 )
&& ( iRightDiff == 0 ) && ( iBottomDiff == 0 ) )
{
innerRect.Shrink( KShrinkSize, 0 );
}
else
{
innerRect.iTl.iX = innerRect.iTl.iX + iLeftDiff;
innerRect.iTl.iY = innerRect.iTl.iY + iTopDiff;
innerRect.iBr.iX = innerRect.iBr.iX - iRightDiff;
innerRect.iBr.iY = innerRect.iBr.iY - iBottomDiff;
}
// ----- draw bitmaps -----
gc->Activate( BitmapDevice() );
//gc->Clear(rect);
// Draw background
if ( iBgSkinId.iMajor )
{
AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(),
*gc,
rect,
innerRect,
iBgSkinId,
KAknsIIDDefault );
}
else if( iFirstBmpId.iMajor && iMiddleBmpId.iMajor && iLastBmpId.iMajor )
{
AknPenInputDrawUtils::Draw3PiecesFrame( AknsUtils::SkinInstance(),
*gc,
rect,
innerRect,
iFirstBmpId,
iMiddleBmpId,
iLastBmpId);
}
else
{
DrawBackground();
}
if ( iForgroundBmp )
{
if( iForgroundBmp->SizeInPixels() != innerRect.Size() )
{
AknIconUtils::SetSize( iForgroundBmp, innerRect.Size(), EAspectRatioNotPreserved );
}
TRect srcRect( TPoint( 0, 0 ), iForgroundBmp->SizeInPixels() );
if( iForgroundBmpMask )
{
if( iForgroundBmpMask->SizeInPixels() != innerRect.Size() )
{
AknIconUtils::SetSize( iForgroundBmpMask, innerRect.Size(), EAspectRatioNotPreserved);
}
gc->BitBltMasked( innerRect.iTl,
iForgroundBmp,
srcRect,
iForgroundBmpMask,
EFalse);
}
else
{
gc->BitBlt( innerRect.iTl,
iForgroundBmp,
srcRect );
}
}
if ( iText )
{
gc->SetBrushStyle( CGraphicsContext::ENullBrush );
TAknLayoutText textLayout;
textLayout.LayoutText(Rect(), iTextFormat);
TRgb color( KRgbBlack ); // sane default for nonskinned case
if ( AknsUtils::AvkonSkinEnabled() )
{
AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
color, KAknsIIDQsnTextColors, iTextColorIndex );
}
//.........这里部分代码省略.........
示例9: CreateColorIconLC
EXPORT_C void AknsUtils::CreateColorIconLC(
MAknsSkinInstance* aInstance, const TAknsItemID& aID,
const TAknsItemID& aColorID, const TInt aColorIndex,
CFbsBitmap*& aBitmap, CFbsBitmap*& aMask,
const TDesC& aFilename,
const TInt aFileBitmapId, const TInt aFileMaskId,
const TRgb aDefaultColor,
const TSize& aSize, const TScaleMode aScaleMode )
{
CFbsBitmap* bitmap = NULL;
CFbsBitmap* mask = NULL;
CreateIconLC( aInstance, aID, bitmap, mask,
aFilename, aFileBitmapId, aFileMaskId ); // (2)
TRgb color = aDefaultColor;
// Return value intentionally ignored
GetCachedColor( aInstance, color, aColorID, aColorIndex );
if( AknIconUtils::IsMifIcon( bitmap ) )
{
AknIconUtils::SetIconColor( bitmap, color );
aBitmap = bitmap;
aMask = mask;
}
else // Create Own Icon
{
CFbsBitmap* colorBitmap = new (ELeave) CFbsBitmap();
CleanupStack::PushL( colorBitmap ); // (3)
TSize size = mask->SizeInPixels();
User::LeaveIfError(
colorBitmap->Create( size,
CEikonEnv::Static()->ScreenDevice()->DisplayMode() ) );
CFbsBitmapDevice* colorBmpDev = CFbsBitmapDevice::NewL( colorBitmap );
CleanupStack::PushL( colorBmpDev ); // (4)
User::LeaveIfError( colorBmpDev->Resize( size ) );
CFbsBitGc* colorBmpGc = CFbsBitGc::NewL();
CleanupStack::PushL( colorBmpGc ); // (5)
colorBmpGc->Activate( colorBmpDev );
colorBmpGc->SetBrushColor( color );
colorBmpGc->SetPenStyle( CGraphicsContext::ENullPen );
colorBmpGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
colorBmpGc->DrawRect( TRect( TPoint(0,0), size ) );
CleanupStack::PopAndDestroy( 2 ); // colorBmpGc, colorBmpDev (3)
CleanupStack::Pop( 3 ); // colorBmp, bitmap, mask (0)
delete bitmap; // We don't know the order, must destroy manually
aBitmap = colorBitmap;
aMask = mask;
// These are both safe
CleanupStack::PushL( aBitmap ); // (1)
CleanupStack::PushL( aMask ); // (2)
}
if( aSize.iWidth>=0 )
{
// Set the size
User::LeaveIfError(
AknIconUtils::SetSize( aBitmap, aSize, aScaleMode ) );
}
}
示例10: DrawItem
// CFepLayoutChoiceList::DrawItem
// Draw a choice list item.
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//
void CFepLayoutChoiceList::DrawItem(const TRect& aRect, const CFepLayoutChoiceList::SItem& aItem,
TBool aErase, TBool aFocus)
{
if(iWndControl)
return;
CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
if( aErase )
{
SetBorderColor( BkColor() );
//DrawChoiceListBackground( aRect );//, EFalse);
}
if( aFocus )
{
//draw focus bitmap
TRect rtFocusRect(iItemFocusRect);
TRect rtFocusInBmp(TPoint(0,0), iItemFocusRect.Size());
rtFocusRect.Move(aRect.iTl);
TRect rtInnerRect( rtFocusRect );
rtInnerRect.Shrink( 5, 5 );
if( iSubItemSkinID.iMajor != EAknsMajorNone &&
iSubItemSkinID.iMinor != EAknsMinorNone)
{
gc->Activate( BitmapDevice() );
AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(),
*gc,
rtFocusRect,
rtInnerRect,
iSubItemSkinID,
KAknsIIDDefault );
}
else
{
//mask bitmaps-------
gc->Activate( MaskBitmapDevice() );
if( iItemFocusBmpMask )
{
DrawBitmap(rtFocusRect, rtFocusInBmp, iItemFocusBmpMask,
iItemFocusBmpMask->SizeInPixels() == rtFocusInBmp.Size());
}
//front bitmaps-------
gc->Activate( BitmapDevice() );
if( iItemFocusBmp )
{
DrawBitmap(rtFocusRect, rtFocusInBmp, iItemFocusBmp,
iItemFocusBmp->SizeInPixels() == rtFocusInBmp.Size());
}
}
}
//draw text
if (iFont)
{
gc->UseFont(iFont);
gc->SetBrushStyle( CGraphicsContext::ENullBrush );
gc->SetPenColor(iFontColor);
gc->SetPenStyle(CGraphicsContext::ESolidPen);
gc->DrawText(aItem.iText, aRect, iBaseline, CGraphicsContext::ELeft, iMargin);
gc->DiscardFont();
}
}