×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    54

    Scaling svg images in context pane

    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
    Join Date
    Sep 2006
    Location
    Helsinki
    Posts
    109

    Re: Scaling svg images in context pane

    If you set picture through CAknContextPane::SetPictureL method, does it scale correctly?
    Teemu Kurppa
    Blog: http://dirtyaura.org/blog

  3. #3
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    54

    Re: Scaling svg images in context pane

    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
    Join Date
    Sep 2006
    Location
    Helsinki
    Posts
    109

    Re: Scaling svg images in context pane

    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
    Join Date
    Jan 2007
    Posts
    54

    Re: Scaling svg images in context pane

    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
    Join Date
    Sep 2006
    Location
    Helsinki
    Posts
    109

    Cool Re: Scaling svg images in context pane

    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
    Join Date
    Jan 2007
    Posts
    54

    Re: Scaling svg images in context pane

    Hello teemukurppa,

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

    Regards
    lapetron

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Scaling svg images in context pane

    It might be the missing viewbox-issue: http://wiki.forum.nokia.com/index.ph...wBox_attribute

  9. #9
    Regular Contributor
    Join Date
    Jan 2007
    Posts
    54

    Re: Scaling svg images in context pane

    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
    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
    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
  •  
×