×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    47

    Unhappy Need help,how to get all the icons

    Hi,all.
    I am tring to get all the icons of the applications installed.I used the function GetAppIcon(uid,fullName) under RApaLsSession to get the absolute path of the .mif file successfully,just like 'Z:\resource\apps\MsgMailEditor_aif.mif'.
    And I tried to get the bitmap and the mask with the function AknIconUtils::CreateIconL(bitmap,mask,fullNmae,0,1) ,but I get an error with -1,I thought maybe the '0,1' is not correct, then I tried to get the bitmapId and maskId with AknIconUtils::ValidateLogicalAppIconId(fullName,bitmapId,maskId),
    but I got the numbers just like -858977076.
    Does anyone give me some help,what's wrong with my code, or how can I get all the icons ,or how to load .mif file and display it?
    thanks,all.

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: Need help,how to get all the icons

    Hi,

    1/ I'm not sure why the ValidateLogicalAppIconId does not work... According to this wiki article it should be fine:
    http://wiki.forum.nokia.com/index.ph...MBM_MIF_images

    2/ Why you do not use another RApaLsSession method to get application icon: GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap &aAppBitmap)?

    3/ You can try to use as image id number 16384 (start Id for mif) and higher...

    BR
    STeN

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    47

    Re: Need help,how to get all the icons

    thanks stenlik.

    OK,I have solved it.

    And I get that :
    1.AknIconUtils need the environment 'CEikonEnv'.

    2.The bitmap id must be 0x4000(16384).

    ps: With RApaLsSession::GetAppIcon(uid,size,bitmap),I can only get the mask.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Need help,how to get all the icons

    You got the KErrNotFound (-1) because Avkon utilities are prepared to handle scalable and non-scalable icon files automatically: if an icon id is less than 16384, AknIconUtils will try to open a .mbm file (regardless of the extension you supply), if it is greater or equal than 16384, the file extension will be .mif

  5. #5
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037

    Re: Need help,how to get all the icons

    Hi,

    I recommended you to use the RApaLsSession::GetAppIcon(), as I'm using it without any problems. I have no idea what is behind your problem related to getting mask only.

    BR
    STen

  6. #6
    Registered User
    Join Date
    Nov 2008
    Posts
    47

    Re: Need help,how to get all the icons

    Hi,stenlik:
    I also don't know why I only get the mask.

    But I have a question:
    RApaLsSession::GetAppIcon() have a parameter with the tpye of CApaMaskedBitmap,
    I think it means that it is a mask,isn't it?

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: Need help,how to get all the icons

    Quote Originally Posted by linlin_0 View Post
    But I have a question:
    RApaLsSession::GetAppIcon() have a parameter with the tpye of CApaMaskedBitmap,
    I think it means that it is a mask,isn't it?
    Generally I agree, "think"-ing is extremely important.
    However from time to time you can benefit from RTFM:
    CApaMaskedBitmap=CFbsBitmap+Mask+SetMaskBitmap+some constructors/destructor, streaming operations.
    Quote Originally Posted by SDK Help
    class CApaMaskedBitmap : public CFbsBitmap;
    Description
    An application icon.

    This is a bitmap and a mask, managed by the Font and Bitmap server.

    An object of this type is passed to RApaLsSession::GetAppIcon() to fetch a suitable application icon.

    Derivation
    CBase - Base class for all classes to be instantiated on the heap
    CFbsBitmap - A bitmap managed by the font and bitmap server
    CApaMaskedBitmap - An application icon
    Members
    Defined in CApaMaskedBitmap:
    ExternalizeL(), InternalizeL(), Mask(), NewL(), NewLC(), SetMaskBitmap(), ~CApaMaskedBitmap()
    So it is a CFbsBitmap, which has an other CFbsBitmap (the mask) associated via Mask/SetMaskBitmap.
    If iMaskedBitmap is CApaMaskedBitmap, you can
    Code:
    TPoint point(0,0);
    TRect rect(point,iMaskedBitmap->SizeInPixels());
    gc.BitBltMasked(point,iMaskedBitmap,rect,iMaskedBitmap->Mask());
    (if it does not work, try adding ,ETrue or ,EFalse at the end).

Similar Threads

  1. Grid app is crashing... need urgent help...
    By shankha in forum Symbian
    Replies: 5
    Last Post: 2010-10-19, 12:07
  2. HOWTO: SVG Application icons
    By stenlik in forum Symbian User Interface
    Replies: 1
    Last Post: 2007-01-11, 22:16
  3. How to place flash-made icons in S60 Theme Studio?
    By heylife in forum Streaming and Video
    Replies: 0
    Last Post: 2006-03-21, 12:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×