View a printable version of the current page.
  Wiki > Symbian Developer Network Public Wiki > ... > Example source code > Get applications icon
  Get applications icon
Added by alie, last edited by rodders on Feb 15, 2008  (view change)
Labels: 
(None)

Symbian v8.1a and v9.x

 CGulIcon* CMyClass::GetAppIcon(TUid aAppUid, TAknsAppIconType aType, const TSize& aIconSize)
	{
	TRect rect;
	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);

	MAknsSkinInstance* skin = AknsUtils::SkinInstance();

	CFbsBitmap* bmp;
	CFbsBitmap* bmp_mask;
	AknsUtils::CreateAppIconLC(skin, aAppUid, aType, bmp, bmp_mask);
	AknIconUtils::SetSize(bmp, aIconSize, EAspectRatioPreserved);
	AknIconUtils::SetSize(bmp_mask, aIconSize, EAspectRatioPreserved);

	CleanupStack::Pop(2);

        return CGulIcon::NewL(bmp, bmp_mask);
	}

Symbian pre8.1a

 RApaLsSession apaLsSession;
apaLsSession.Connect();
CApaMaskedBitmap *appBitmap = CApaMaskedBitmap::NewLC();
apaLsSession.GetAppIcon(appUid, TSize(256,256), *appBitmap)
CleanupStack::PopAndDestroy();
apaLsSession.Close();
Interactive Services Terms & Conditions of use | Terms of use | Privacy policy | Media Center | Contact us | © 2008 Symbian