×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    SVG quality - can it be better?

    Hello everyone,

    I went through all documents that are mentioned on this forum and went through the source code of ScalableScreenDrawing example. I was able to write my own application which loads SVG image from mif file and draws that image on main pane of my application.
    The thing is that image that I draw is not perfect and it should be because it is a vector image. I tried a lot of variations but didn't have any success. Then I thought that maybe it can not be shown better then it is in my application but I found SVG viewer on my E50 device and I saw that SVG looks perfect in that application.

    Does anyone know if default Nokia 3rd edition SVG viewer application uses some anti aliasing algorithm to show smooth images or maybe I'm doing something wrong? If my approach for showing SVG images is correct, does anyone know how can I perform some anti aliasing to show my image with smooth edges?

    Here is how I do this:

    1. First load image from mif file (in ConstructL):
    Code:
    _LIT(KIconsFile,  "\\resource\\apps\\myapp_aif.mif");
    
    iBitmap = AknIconUtils::CreateIconL(KIconsFile, EMbmMyAppLogo);
    2. Then I set the size of image:
    Code:
    TPixelsTwipsAndRotation pixTwipsRot;
    CCoeEnv::Static()->ScreenDevice()->GetDefaultScreenSizeAndRotation(pixTwipsRot);
    TSize size = pixTwipsRot.iPixelSize;
        
    AknIconUtils::SetSize(iBitmap, TSize(size.iWidth, size.iHeight));
    3. And finally I draw the image:
    Code:
    CWindowGc& gc = SystemGc();
    gc.Clear();
    
    gc.BitBlt(TPoint(0, 0), iBitmap);
    iBitmap is pointer to CFbsBitmap class. Should I maybe use some other class for SVG image loading and drawing?
    Just not to be taken wrong, image that is drawn on screen looks good but not the same as it looks in built-in SVG viewer application and I have to make it to look as good as it looks in built-in SVG viewer.

    I will appriciate any help. Thx in advance.

  2. #2
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    Re: SVG quality - can it be better?

    I also tried to convert my SVG image to SVG-T but got the same results.

    Is there anyone who can help me with this? I would really appriciate any kind of help/tip.

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: SVG quality - can it be better?

    S60 devices are redundant indeed. They usually have 2-3 XML parsers (some of them can be used via certain API-s, some of them cannot be used by 3rd party developers), 2 browsers (both of them can be used by the user, however the dumber is the default one), etc.
    Thus it is highly possible that the viewer application has its private high-quality renderer and it might not be available to other applications (including the ones made by 3rd party developers) at all.

  4. #4
    Regular Contributor
    Join Date
    Mar 2004
    Location
    Novi Sad - Serbia
    Posts
    63

    Re: SVG quality - can it be better?

    Thank you wizard_hu_,

    I spent some more time on investigating this problem but didn't find any solution for drawing SVG with smooth borders. It looks almost perfect in some sizes but in general it is not that perfect as it is in built-in SVG viewer.

    Finally, I performed next workaround: used two bitmaps with different sizes, in my Draw method I check the size of client rect and depending on current resolution I put smaller or bigger bitmap. It is not perfect solution but looks fine.

Similar Threads

  1. TinyLine SVG Player and SDK 1.8.2 released.
    By girow in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-03-10, 07:32
  2. TinyLine SVG Player and SDK 1.8.2 released.
    By girow in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2005-03-10, 07:31
  3. TinyLine SVG Player and SDK 1.8.2 released.
    By girow in forum Mobile Java General
    Replies: 0
    Last Post: 2005-03-10, 07:30
  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
  •  
×