×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2005
    Location
    Berlin, Germany
    Posts
    48

    SVG graphics for tab icons

    I want to use SVGs on the navipane-decorator. In the rss-file of the
    application I allready have the old bitmaps but now I want to use SVGs
    instead.
    Code:
    RESOURCE NAVI_DECORATOR r_myapp_navi_decorator
    {
     type=ENaviDecoratorControlTabGroup;
      control=TAB_GROUP
     {
      tab_width=EAknTabWidthWithTwoTabs;
            active=0;
            tabs=
      {
       TAB
       {
        id=EMyappFirstPage;
        bmpfile=MYAPP_MBM;
        bmpid=EMyappFirst;
        bmpmask=EMyappFirst_mask;
       },
       TAB
       {
        id=EMyappSecondPage;
        bmpfile=MYAPP_MBM;
        bmpid=EMyappSecond;
        bmpmask=EMyappSecond_mask;
       }
      };
     };
    }
    Is this possible in the same way? I tried it but it didnt work. There was nothing drawn on the tabs. Maybe thats because I dont "scale" the SVG-image (via setsize()).

    Another question: How can I scale the image when I do all the tab definitions via a resource-file (like shown above)?

    Martin
    Last edited by TPMaKom; 2005-12-01 at 08:47.

  2. #2
    Registered User
    Join Date
    Nov 2005
    Location
    Berlin, Germany
    Posts
    48

    Re: SVG graphics for tab icons

    I ve found the solution. Within the ConstructL() function of the AppUi-class the following code can be inserted for replacing the text with svg icons.
    Code:
    if (iDecoratedTabGroup)
    {
      TFileName iconfile(_L("\\resource\\apps\\myapp_svg.mif")); // iconfile containing SVGs
      
      TUint16      bitmapindex = EMbmMyApp_svgTabIcon; // from mbg-enum
      CFbsBitmap *bitmap = AknIconUtils::CreateIconL(iconfile, bitmapindex);
      CFbsBitmap *mask = AknIconUtils::CreateIconL(iconfile, bitmapindex+1);
      
      //TSize twipsSize(bitmap->SizeInTwips());
      TSize iconSize(68, 22);
      AknIconUtils::SetSize(bitmap, iconSize);
      AknIconUtils::SetSize(mask, iconSize);
      
      iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
      
      // replace tabtext with images
      iTabGroup->ReplaceTabL(EViewGUIView1Tab, bitmap, mask);
      iTabGroup->ReplaceTabL(EViewGUIView2Tab, bitmap, mask);
      iTabGroup->SetObserver( this );
    }
    This example was tested with 3rd edition but I think it works on 2nd fp3 either.

    Martin

  3. #3
    Registered User
    Join Date
    Nov 2005
    Location
    Berlin, Germany
    Posts
    48

    Re: SVG graphics for tab icons

    I ve found the solution by myself. For every ReplaceTabL() I have to create new pointers to bitmap and mask!

  4. #4
    Registered User
    Join Date
    Nov 2005
    Location
    Berlin, Germany
    Posts
    48

    Re: SVG graphics for tab icons

    Admin? Could you please ban this Spammer from this forum?

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