当前位置: 首页>>代码示例>>C++>>正文


C++ CFbsBitGc类代码示例

本文整理汇总了C++中CFbsBitGc的典型用法代码示例。如果您正苦于以下问题:C++ CFbsBitGc类的具体用法?C++ CFbsBitGc怎么用?C++ CFbsBitGc使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了CFbsBitGc类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: new

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;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:30,代码来源:TBMPAnimStep.cpp

示例2: DrawOpaqueMaskBackground

// 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();			
 		}	
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:32,代码来源:peninputlayoutchoicelist.cpp

示例3: new

CFbsBitmap* AknBitmapMirrorUtils::CreateBitmapL(CFbsBitmap* aSourceBitmap, TInt aMirrorDirection)
    {
    User::LeaveIfNull(aSourceBitmap);
    CFbsBitmap* destinationBitmap = new (ELeave) CFbsBitmap();
    CleanupStack::PushL(destinationBitmap);   

    TSize sourceBitmapSize = aSourceBitmap->SizeInPixels();            
    TRect sourceRect = TRect(TPoint(0,0), sourceBitmapSize);
    TSize destinationBitmapSize(sourceRect.Width(), sourceRect.Height()); 

    User::LeaveIfError(destinationBitmap->Create(destinationBitmapSize, aSourceBitmap->DisplayMode()));

    CFbsBitmapDevice* destinationDevice = CFbsBitmapDevice::NewL( destinationBitmap );
    CleanupStack::PushL(destinationDevice);

    CFbsBitGc* destinationGc;
    User::LeaveIfError( destinationDevice->CreateContext( destinationGc ) );

    switch (aMirrorDirection)
        {
        case EAknVerticalMirroring:
            {
            TRect sourceBitmapBlittingRect( sourceRect.iTl.iX,sourceRect.iTl.iY,sourceRect.iBr.iX,sourceRect.iTl.iY + 1 );  
            for ( TInt yPos=destinationBitmapSize.iHeight-1; yPos >= 0; yPos-- )
                {
                destinationGc->BitBlt( TPoint(0,yPos), aSourceBitmap, sourceBitmapBlittingRect );
                sourceBitmapBlittingRect.iTl.iY++;
                sourceBitmapBlittingRect.iBr.iY++;
                }
            break;
            }

        case EAknHorizontalMirroring:
            {
            TRect sourceBitmapBlittingRect( sourceRect.iTl.iX,sourceRect.iTl.iY,sourceRect.iTl.iX + 1,sourceRect.iBr.iY );      
            for ( TInt xPos=destinationBitmapSize.iWidth-1; xPos >= 0; xPos-- )
                {
                destinationGc->BitBlt( TPoint(xPos,0), aSourceBitmap, sourceBitmapBlittingRect );
                sourceBitmapBlittingRect.iTl.iX++;
                sourceBitmapBlittingRect.iBr.iX++;
                }
            break;
            }

        default:
            {
            destinationGc->BitBlt( TPoint(0,0), aSourceBitmap, sourceRect );
            break;
            }
        }

    delete destinationGc;  
    CleanupStack::Pop(2); // destinationBitmap, destinationDevice
    delete destinationDevice;

    return destinationBitmap;   
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:57,代码来源:AknBitmapMirrorUtils.cpp

示例4: DrawBitmap

// CFepLayoutChoiceList::DrawBitmap
// Draw bitmap helper function.
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//
void CFepLayoutChoiceList::DrawBitmap(const TRect& aDestRect, const TRect& aSrcRect, 
                                      CFbsBitmap* aBmp, TBool aFast)
    {
    CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());
    if( aFast )
        {
         gc->BitBlt(aDestRect.iTl, aBmp, aSrcRect);
        }
    else
        {
        gc->DrawBitmap(aDestRect, aBmp, aSrcRect);
        }
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:18,代码来源:peninputlayoutchoicelist.cpp

示例5: STATIC_CAST

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
	}
开发者ID:Yelinson,项目名称:OpenVideoHub,代码行数:50,代码来源:emTubeSplashViewContainer.cpp

示例6: CreateSoftwareBitmapLC

/**
Draws a stretched bitmap with or without a mask.

@param aUseMask set to ETrue to use a alpha mask. Normally used for 16MU display modes that do not store the alpha.
@param aSrcMode is the source display mode
@param aDstMode is the destination display mode
@param aSession is the windows server session
@param aWindow is a reference to the window
@param aGc is the graphics context of the window
@param aNumIterations is the number of iterations to run the test
*/
void CAlphaBlendTest::DoDrawBitmapL(TBool aUseMask, TDisplayMode aSrcMode, TDisplayMode aDstMode, RWsSession& aSession, RWindow& aWindow, CWindowGc* aGc, TInt aNumIterations)
	{		
	const TSize bitmapSize = aWindow.Size();
	
	// Construct target bitmap.
	CFbsBitmap* bitmapTarget = CreateSoftwareBitmapLC(bitmapSize, aDstMode);
	CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(bitmapTarget);
	CleanupStack::PushL(bitmapDevice);
	
	// Construct GC.
	CFbsBitGc* bitmapGc = NULL;
	User::LeaveIfError(bitmapDevice->CreateContext(bitmapGc));
	CleanupStack::PushL(bitmapGc);
	
	// Construct source bitmap.	
	TSize smallerSize(bitmapSize.iWidth/2,  bitmapSize.iHeight/2);
	CFbsBitmap* source = CreateSoftwareBitmapLC(smallerSize, aSrcMode);
	VerticalGradientAlphaL(source, TRgb(0x00000000), TRgb(0xffffffff));	
	CFbsBitmap* sourceAlpha = CreateSoftwareBitmapLC(smallerSize, EGray256);	// match size to src
	VerticalGradientAlphaL(sourceAlpha, TRgb(0x01010101), TRgb(0xfefefefe));
		
	bitmapGc->SetBrushStyle(CGraphicsContext::ENullBrush);
	bitmapGc->SetBrushColor(TRANSPARENT_BLACK);
	bitmapGc->Clear();
	bitmapGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
	aGc->Activate(aWindow);
	TPoint point(0,0);
	bitmapGc->BitBlt(point, bitmapTarget);
	aGc->Deactivate();
	aSession.Flush();

	TBuf <20> testName;
	if (!aUseMask)
		{
		testName=_L("DrawBitmap");
		iProfiler->InitResults();
		for(int i=0; i<aNumIterations; i++)
			{
			bitmapGc->DrawBitmap(TRect(point, bitmapSize), source);
			iProfiler->MarkResultSetL();
			}
		}
	else
		{
		testName=_L("DrawBitmapMasked");
		iProfiler->InitResults();
		for(int i=0; i<aNumIterations; i++)
			{
			bitmapGc->DrawBitmapMasked(TRect(point, bitmapSize), source,TRect(point, smallerSize), sourceAlpha, EFalse);
			iProfiler->MarkResultSetL();
			}
		}
	INFO_PRINTF4(_L("%S(Stretched) with src = %S, dst = %S"), &testName, &ColorModeName(aSrcMode), &ColorModeName(aDstMode));
	iProfiler->ResultsAnalysis(testName, 0, aSrcMode, aDstMode, aNumIterations);
	// copy up to screen for sanity check
	BitBlt(aSession, aWindow, aGc, *bitmapTarget);
	CleanupStack::PopAndDestroy(5, bitmapTarget);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:69,代码来源:talphablend.cpp

示例7:

void CTap2MenuAppUi::CopyBitmapL(CFbsBitmap *aSource, CFbsBitmap *aTarget)
	{
	if(aSource != NULL && aTarget != NULL)
		{
		if(aSource->SizeInPixels() != aTarget->SizeInPixels() || aSource->DisplayMode() != aTarget->DisplayMode())
			{User::Leave(KErrArgument);}
		CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(aTarget);
		CleanupStack::PushL(device);
		CFbsBitGc* gc = NULL;
		User::LeaveIfError(device->CreateContext(gc));
		CleanupStack::PushL(gc);
		gc->BitBlt(TPoint(0, 0), aSource);
		CleanupStack::PopAndDestroy(gc);
		CleanupStack::PopAndDestroy(device);
		}
	}
开发者ID:kolayuk,项目名称:Tap2Menu,代码行数:16,代码来源:Tap2MenuAppUi.cpp

示例8: TRAP_IGNORE

// -----------------------------------------------------------------------------
// 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 );
        );
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:20,代码来源:MaskedBitmap.cpp

示例9: new

/**
Copy a source bitmap into a new bitmap with the specified display mode
*/
CFbsBitmap* CTe_graphicsperformanceSuiteStepBase::CopyIntoNewBitmapL(CFbsBitmap* aSrc, TDisplayMode aDisplayMode)
	{
	CFbsBitmap* dstBmp = new(ELeave) CFbsBitmap;
	CleanupStack::PushL(dstBmp);
	TInt ret=dstBmp->Create(aSrc->SizeInPixels(), aDisplayMode);
	User::LeaveIfError(ret);
	CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(dstBmp);
	CleanupStack::PushL(bitmapDevice);
	CFbsBitGc* gc;
	ret = bitmapDevice->CreateContext(gc);
	User::LeaveIfError(ret);
	CleanupStack::PushL(gc);
	gc->BitBlt(TPoint(0,0), aSrc);
	CleanupStack::PopAndDestroy(2, bitmapDevice); // gc, bitmapDevice
	CleanupStack::Pop(dstBmp);
	return dstBmp;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:20,代码来源:te_graphicsperformanceSuiteStepBase.cpp

示例10: new

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;
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:17,代码来源:WFBitmapUtil.cpp

示例11: ClearRect

// ---------------------------------------------------------------------------
// CFepUiLayoutRootCtrl::DrawFrame
// Draw moving frame
// (other items were commented in a header).
// ---------------------------------------------------------------------------
//    
TRect CFepUiLayoutRootCtrl::DrawFrame(const TRect& aFrameRect, TBool aDrawFlag)
    {   
    
    //clear shadow when moving
    TBool updateShadowArea = EFalse;
    TRect dirtyRect;
    if(iShadowShown)
        {
        ClearRect(iShadowRect);
        iShadowShown = EFalse;
        updateShadowArea = ETrue;
        }
    
   
    TRect bmpRect;
    TPoint bmpPos;
    
    CFbsBitGc* gc = static_cast<CFbsBitGc*>(BitGc());       

    //draw mask background  
    TRgb maskPenCol = aDrawFlag ? TRgb(KOpaqueColor) : TRgb(KTransparentColor);
  	DrawBackgroundToDevice(aFrameRect,MaskBitmapDevice(), 0, 
    				//TRgb(KTransparentColor), TRgb(KOpaqueColor),EFalse);
    				TRgb(KTransparentColor), maskPenCol,EFalse);

	//draw background
	TRgb penCor = aDrawFlag ? KRgbBlack : KRgbWhite;
	TAknsQsnOtherColorsIndex clrIndex;
    clrIndex = EAknsCIQsnOtherColorsCG9;

    if ( AknsUtils::AvkonSkinEnabled() )
        {
        AknsUtils::GetCachedColor( AknsUtils::SkinInstance(),
                               penCor, KAknsIIDQsnTextColors, clrIndex );
        }

  	DrawBackgroundToDevice(aFrameRect,BitmapDevice(),0,TRgb(KRgbWhite),penCor,EFalse);
	    
    gc->RectDrawnTo(dirtyRect);        
    
    if(updateShadowArea)
        return iShadowRect;
    else
        return dirtyRect;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:51,代码来源:peninputlayoutrootctrl.cpp

示例12: bitmap

/**
Copy a bitmap into another bitmap (generally in a different displaymode)
tiles destination bitmap with source
*/
void CTe_graphicsperformanceSuiteStepBase::CopyBitmapL(CFbsBitmap* aDst, CFbsBitmap* aSrc)
	{
	TSize srcSize = aSrc->SizeInPixels();
	TSize dstSize = aDst->SizeInPixels();
	CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(aDst);
	CleanupStack::PushL(dev);
	CFbsBitGc* gc = NULL;
	if ( 0 == dev->CreateContext(gc) )
		{
		CleanupStack::PushL(gc);
		TPoint point;
		gc->SetBrushColor(TRANSPARENT_BLACK);
		gc->SetBrushStyle(CGraphicsContext::ENullBrush);
		gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
		gc->Clear();
		gc->SetDrawMode(CGraphicsContext::EDrawModePEN);
		for(point.iY=0; point.iY<dstSize.iHeight; point.iY+=srcSize.iHeight)
			{
			for(point.iX=0; point.iX<dstSize.iWidth; point.iX+=srcSize.iWidth)
				{
				gc->BitBlt(point, aSrc);
				}
			}
		CleanupStack::PopAndDestroy(gc);
		}
	CleanupStack::PopAndDestroy(dev);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:31,代码来源:te_graphicsperformanceSuiteStepBase.cpp

示例13: bitmap

/**
Auxilary function called to Copy the screen to bitmap (mbm) file.
@param aHashIndex contains hashID. Bitmap is created with the aHashIndex as name
*/
EXPORT_C void CTHashReferenceImages::CopyScreenToBitmapL(const TDesC& aHashIndex)
	{
	CFbsBitmap *bitmap = new(ELeave)CFbsBitmap();
	CleanupStack::PushL(bitmap);
	User::LeaveIfError(bitmap->Create(iBitmapDevice->SizeInPixels(), iBitmapDevice->DisplayMode()));
	TRect rect = TRect(iBitmapDevice->SizeInPixels());
	CFbsBitmapDevice *device=CFbsBitmapDevice::NewL(bitmap);
	CleanupStack::PushL(device);
	CFbsBitGc *gc;
	User::LeaveIfError(device->CreateContext(gc));
	gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
	gc->BitBlt(TPoint(), iBitmap, rect);
	TFileName mbmFile;
	mbmFile.Format(iPath->Des(), &aHashIndex);
	bitmap->Save(mbmFile);
	delete gc;
	CleanupStack::PopAndDestroy(2);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:22,代码来源:thashreferenceimages.cpp

示例14: Draw

void CTransparentBitmap::Draw(CFbsBitGc& gc,TInt aX, TInt aY)
	{
//	gc.BitBlt(TPoint(aX,aY),iMaskBitmap);
	if (iSrcBitmap && iMaskBitmap)
		{
		TRect sourceRect( TPoint( 0,0 ),iSrcBitmap->SizeInPixels() );
		gc.BitBltMasked(TPoint(aX,aY),iSrcBitmap,sourceRect,iMaskBitmap,ETrue);
		}
	}
开发者ID:flaithbheartaigh,项目名称:lemonplayer,代码行数:9,代码来源:TransparentBitmap.cpp

示例15: BitBlt

// -----------------------------------------------------------------------------
// CMaskedBitmap::BitBlt
// -----------------------------------------------------------------------------
void CMaskedBitmap::BitBlt( CFbsBitGc& aContext, const TPoint& aPoint ) const
    {
    TSize s(iBitmap->SizeInPixels());
    if (!(s.iWidth>0 && s.iHeight>0))
        {
        return;
        }
    if( iBitmap->Handle() )
        {
        if( iMask->Handle() )
            {
            aContext.BitBltMasked( aPoint, iBitmap, s, iMask, iInvertMask );
            }
        else
            {
            aContext.BitBlt( aPoint, iBitmap, s );
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:22,代码来源:MaskedBitmap.cpp


注:本文中的CFbsBitGc类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。