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


C++ CFbsBitmap::Duplicate方法代码示例

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


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

示例1: ViewFinderStartStop

void CRecognizerContainer::ViewFinderStartStop()
{
	CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("ViewFinderStartStop"));
	Reporting().DebugLog(_L("ViewFinderStartStop"));

	started=true;

	if (!iVCS || !iTakingPicture) {
		delete iVCS; iVCS=0; iBitmap=0;
		iVCS=new (ELeave) CVisualCodeSystem(AppContext());
		iVCS->ConstructL();
		iVCS->AddObserver(this);
	}
	if (iTakingPicture) {
		if (iBitmap) {
			CFbsBitmap* temp=iBitmap;
			iBitmap=new (ELeave) CFbsBitmap;
			owns_bitmap=true;
			User::LeaveIfError(iBitmap->Duplicate(temp->Handle()));
		}
		delete iVCS; iVCS=0;
		iTakingPicture=FALSE;
	} else {
		iTakingPicture = TRUE;
		// start with: updates on, translation off, rotation off, low-quality recognition on
		iVCS->Start(TRUE, FALSE, FALSE, TRUE);
	}
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:28,代码来源:RecognizerView.cpp

示例2: SetDestinationBitmapL

void CMMABitmapWindow::SetDestinationBitmapL(CFbsBitmap* aBitmap)
{
    CFbsBitmap* bitmap = new(ELeave)CFbsBitmap();
    CleanupStack::PushL(bitmap);
    User::LeaveIfError(bitmap->Duplicate(aBitmap->Handle()));

    // create context for bitmap
    CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(aBitmap);
    CleanupStack::PushL(bitmapDevice);


    CGraphicsContext* bitmapContext = NULL;
    User::LeaveIfError(bitmapDevice->CreateContext(bitmapContext));

    CleanupStack::Pop(bitmapDevice);   // bitmapDevice
    CleanupStack::Pop(bitmap);   // bitmap

    delete iBitmap;
    iBitmap = bitmap;
    delete iBitmapDevice;
    iBitmapDevice = bitmapDevice;
    delete iBitmapContext;
    iBitmapContext = bitmapContext;

    if (iDrawRect.IsEmpty())
    {
        iDrawRect.SetSize(iBitmap->SizeInPixels());
    }
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:29,代码来源:cmmabitmapwindow.cpp

示例3: DrawFrameL

void CMMABitmapWindow::DrawFrameL(const CFbsBitmap* aBitmap)
{
    if (iBitmap)
    {
        // leave in this function will panic thread
        CFbsBitmap* bitmap = new(ELeave)CFbsBitmap();
        CleanupStack::PushL(bitmap);
        User::LeaveIfError(bitmap->Duplicate(aBitmap->Handle()));
        // set incoming bitmap display mode to 16MA
        if (EColor16MU == bitmap->DisplayMode())
        {
            bitmap->SetDisplayMode(EColor16MA);
        }
        AknIconUtils::ScaleBitmapL(iDrawRect, iBitmap, bitmap);
        CleanupStack::PopAndDestroy(bitmap);
    }
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:17,代码来源:cmmabitmapwindow.cpp

示例4: INFO_PRINTF1


//.........这里部分代码省略.........
			iBitmap.Reset();
			if(heapMarkCheckFlag)
				{
				iFbs->SendCommand(EFbsMessDefaultMarkEnd);
				iFbs->SendCommand(EFbsMessUserMarkEnd);
				}
			continue;
			}
		else if (ret == KErrNone)
			{
			iBitmap.Reset();
			iBitmap2.Reset();
			if(heapMarkCheckFlag)
				{
				iFbs->SendCommand(EFbsMessDefaultMarkEnd);
				iFbs->SendCommand(EFbsMessUserMarkEnd);
				}
			break;
			}
		else 
			TEST2(ret, KErrNone);
	}

	iFbs->SendCommand(EFbsMessDefaultAllocFail,0);
	iFbs->SendCommand(EFbsMessUserAllocFail,0);
	TEST(iFbs->ResourceCount()==0);
	
	
// Duplicate
	CFbsBitmap bmpalt;
	ret = bmpalt.Create(KSmallSize,EColor256);
	TEST2(ret, KErrNone);

	INFO_PRINTF1(_L("CFbsBitmap::Duplicate()\r\n"));
	for (count = 1; ; count++)
		{
		iFbs->SendCommand(EFbsMessDefaultAllocFail,count);
		if(heapMarkCheckFlag)
			{
			iFbs->SendCommand(EFbsMessDefaultMark);
			iFbs->SendCommand(EFbsMessUserMark);
			}

		ret = iBitmap.Duplicate(bmpalt.Handle());

		if (ret == KErrNoMemory)
			{
			if(heapMarkCheckFlag)
				{
				iFbs->SendCommand(EFbsMessDefaultMarkEnd);
				iFbs->SendCommand(EFbsMessUserMarkEnd);
				}
			}
		else if (ret == KErrNone)
			{
			iBitmap.Reset();
			if(heapMarkCheckFlag)
				{
				iFbs->SendCommand(EFbsMessDefaultMarkEnd);
				iFbs->SendCommand(EFbsMessUserMarkEnd);
				}
			break;
			}
		else 
			TEST2(ret, KErrNone);
		}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:67,代码来源:TALLOC.CPP

示例5: CreateAppIconLC


//.........这里部分代码省略.........
                    bitmapIndex, maskIndex ); // aBitmap, aMask (2)
                }
            AknInternalIconUtils::SetAppIcon(aBitmap); //icon case
            return;
            }
        else
            {
            // MBM icon
            AknIconUtils::ValidateLogicalAppIconId( filename,
                bitmapIndex, maskIndex );
            TRAP( ret, AknIconUtils::CreateIconL( aBitmap, aMask, filename,
                bitmapIndex, maskIndex ) );
            if( ret == KErrNone )
                {
                // These pushes are safe
                CleanupStack::PushL( aBitmap ); // (1)
                CleanupStack::PushL( aMask ); // (2)
                }
            else
                {
                bitmapIndex = 0;
                maskIndex = 1;
                AknIconUtils::ValidateLogicalAppIconId( filename,
                    bitmapIndex, maskIndex );
                AknIconUtils::CreateIconLC( aBitmap, aMask, filename,
                    bitmapIndex, maskIndex ); // aBitmap, aMask (2)
                }
            AknInternalIconUtils::SetAppIcon(aBitmap); //icon case
            return;
            }
        }
    else if( ret!=KErrNotSupported )
        {
        // New framework, but no icon defined
        forceDefaultIcon = ETrue;
        }

    CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC(); // apaBmp (1)
    // 3. Old (AIF-based) framework
    if( !forceDefaultIcon )
        {
        TInt apaErr = lsSession->GetAppIcon( aAppUid, legacySize, *apaBmp );
        // Use default icon if APPARC did not initialize icon bitmaps
        if( apaErr || (!apaBmp) || (!apaBmp->Mask()) ||
            (!apaBmp->Handle()) || (!apaBmp->Mask()->Handle()) )
            {
            forceDefaultIcon = ETrue;
            }
        }

    if( forceDefaultIcon )
        {
        // Default icon
        CleanupStack::PopAndDestroy( 1 ); // apaBmp (0)
        TAknsItemID iid = KAknsIIDQgnMenuUnknownLst;
        bitmapIndex = EMbmAvkonQgn_menu_unknown_lst;
        maskIndex = EMbmAvkonQgn_menu_unknown_lst_mask;
        if( aType == EAknsAppIconTypeContext )
            {
            iid = KAknsIIDQgnMenuUnknownCxt;
            bitmapIndex = EMbmAvkonQgn_menu_unknown_cxt;
            maskIndex = EMbmAvkonQgn_menu_unknown_cxt_mask;
            }
        AknsUtils::CreateIconLC( aInstance, iid, aBitmap, aMask,
            AknIconUtils::AvkonIconFileName(), bitmapIndex, maskIndex ); // aBitmap, aMask (2)
        }
    else
        {
        // AIF-based icon
        CFbsBitmap* iconOwnedBitmap = new (ELeave) CFbsBitmap();
        CleanupStack::PushL( iconOwnedBitmap ); // iob (3)
        CFbsBitmap* iconOwnedMask = new (ELeave) CFbsBitmap();
        CleanupStack::PushL( iconOwnedMask ); // iom (4)
        User::LeaveIfError(
            iconOwnedBitmap->Duplicate( apaBmp->Handle() ) );
        User::LeaveIfError(
            iconOwnedMask->Duplicate( apaBmp->Mask()->Handle() ) );

        CAknIcon* tmpIcon = CAknIcon::NewL();
        CleanupStack::Pop( 2 ); // iom, iob (2)
        CleanupStack::PopAndDestroy( 1 ); // apaBmp (0)

        // Ownership is transferred
        tmpIcon->SetBitmap( iconOwnedBitmap );
        tmpIcon->SetMask( iconOwnedMask );
        // Ownership of tmpIcon is transferred
        CAknIcon* appIcon = AknIconUtils::CreateIconL( tmpIcon );

        aBitmap = appIcon->Bitmap();
        aMask = appIcon->Mask();
        // Detach and delete
        appIcon->SetBitmap( NULL );
        appIcon->SetMask( NULL );
        delete appIcon;

        // These are both safe
        CleanupStack::PushL( aBitmap ); // (1)
        CleanupStack::PushL( aMask ); // (2)
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:101,代码来源:AknsUtilsAppIcon.cpp


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