本文整理汇总了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);
}
}
示例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());
}
}
示例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);
}
}
示例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);
}
示例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)
}
}