Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor lapetron's Avatar
    Join Date
    Jan 2007
    Posts
    54
    Hello,

    I want to use some svg images to be displayed in the Context Pane
    (ContextPane::SwapPicture).

    The images (CEikImage) are constructed from resource, the size of every pic is 32x32 px by default.

    I tried several ways to scale image's size to Context Pane's size, but the
    images are always displayed at its original size.

    Does anyone have suggestions how to do this ?

    Thanks in advance.

  2. #2
    Regular Contributor teemukurppa's Avatar
    Join Date
    Sep 2006
    Location
    Helsinki
    Posts
    109
    If you set picture through CAknContextPane::SetPictureL method, does it scale correctly?
    Teemu Kurppa
    Blog: http://dirtyaura.org/blog

  3. #3
    Regular Contributor lapetron's Avatar
    Join Date
    Jan 2007
    Posts
    54
    Hello teemukurppa,

    thanks for answering.

    I also tried to change the icon by using CAknContextPane::SetPicture
    instead of SwapPicture with same result, i.e. no correct scaling.

    Regards
    lapetron

  4. #4
    Regular Contributor teemukurppa's Avatar
    Join Date
    Sep 2006
    Location
    Helsinki
    Posts
    109
    Ok, then there might be some problem with image that you are passing to it. Can you paste code to show how you create/load it, it might reveal the problem.
    Teemu Kurppa
    Blog: http://dirtyaura.org/blog

  5. #5
    Regular Contributor lapetron's Avatar
    Join Date
    Jan 2007
    Posts
    54
    Ok, here's a code snippet of what I'm doing:

    // in class AppUi
    void LoadIcon()
    {
    CAknContextPane* contextIcon = static_cast< CAknContextPane* >
    (StatusPane()->ControlL(
    TUid::Uid(EEikStatusPaneUidContext ) ));
    TRect imageRect;
    TSize imageSize;
    if(NULL != contextIcon)
    {
    imageRect = contextIcon->Rect();
    imageSize = TSize(imageRect.Width(),imageRect.Height());
    }
    else
    {
    imageSize = TSize(64,64);
    }

    CFbsBitmap *bitmap, *mask;

    // image is a member of AppUi
    image = new(ELeave)CEikImage();
    AknIconUtils::CreateIconL(bitmap,mask,
    KIconPath,
    EMbmIcon_aifId,
    EMbmIcon_aifId_mask);
    AknIconUtils::SetSize(bitmap,imageSize,EAspectRatioPreserved);
    AknIconUtils::SetSize(mask,imageSize,EAspectRatioPreserved);
    image->SetPicture(bitmap,mask);
    if(NULL != contextIcon)
    {
    contextIcon->SetPicture(image);
    }
    }


    Hope this helps.

    Regards
    lapetron

  6. #6
    Regular Contributor teemukurppa's Avatar
    Join Date
    Sep 2006
    Location
    Helsinki
    Posts
    109
    Okay, your code seems reasonably ok, so I can't point any specific problem in it.

    However, it works for me, when I load SVG icon, I set size to TSize(0,0) (I don't know if this is needed, but that's what I've in code, sounds unnecessary though), and use CAknContextPane::SetPictureL( CFbsBitmap* aBmp, CFbsBitmap* aMask).

    Try it without setting size (or setting it to TSize(0,0)) and using that different variant of SetPictureL
    Teemu Kurppa
    Blog: http://dirtyaura.org/blog

  7. #7
    Regular Contributor lapetron's Avatar
    Join Date
    Jan 2007
    Posts
    54
    Hello teemukurppa,

    thank you for your help, I'll try it and report later.

    Regards
    lapetron

  8. #8
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,747
    It might be the missing viewbox-issue: http://wiki.forum.nokia.com/index.ph...wBox_attribute

  9. #9
    Regular Contributor lapetron's Avatar
    Join Date
    Jan 2007
    Posts
    54
    Hello wizard_hu,

    I searched for everything about svg-images in wiki.forum,
    but could not find this article.

    But this resolved all my problems.

    Thank you very much for your help.

    @teemukurrpa: Thanks again.

    Regards
    lapetron

Similar Threads

  1. status pane in E61 screen (320x240 ) s603rd
    By francobellu in forum Symbian C++
    Replies: 2
    Last Post: 2008-07-10, 12:48
  2. Context pane Icon not visible over the navi pane??
    By varshajohn in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-05-27, 13:46
  3. Colored images in Navigation pane ???
    By kiranpuranik in forum Symbian C++
    Replies: 1
    Last Post: 2006-06-07, 06:00
  4. TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-05-05, 18:44
  5. TinyLine SVG Minute Toolkit for J2ME: version 1.4 released
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2003-05-05, 16:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved