Hi,
in S60 you can load a SVG image as a bitmap in your application, scale it and display it on the screen using code like below:
CGulIcon* CBitmapDrawContainer::LoadImageL( TInt aIndex )
{
CFbsBitmap* bitmap;
CFbsBitmap* mask;
AknIconUtils::CreateIconL(
bitmap, mask, KMifFileName,
aIndex,
aIndex + 1 );
CleanupStack::PushL( bitmap );
CleanupStack::PushL( mask );
// CGulIcon::NewL takes ownership of bitmap and mask!
CGulIcon* image =
CGulIcon::NewL( bitmap, mask );
CleanupStack::Pop( mask );
CleanupStack::Pop( bitmap );
return image;
}
As far as I can see the MIF file is always created such that there is the bitmap (at position index) and the mask (at position index + 1) in the MIF file. The method above loads both and puts them together in a CGulIcon.
Initially the bitmap will have size TSize(0,0) and you have to call SetSize to scale both the bitmap and the mask (in the CGulIcon).
1) When scaling using this method, does S60 use the underlying SVG image to perform the scale and convert again to bitmap? Can there be any distortion because of this scaling operation?
When displaying the SVG image you can use:
A) gc.BitBlt( topLeft, iButton->Bitmap() );
iButton is a CGulIcon pointer. You can also use:
B) gc.BitBltMasked( topLeft, iButton->Bitmap(),
buttonRect, iButton->Mask(), EFalse );
After some experimentation it turns out some SVGs show fine using the bitmap + mask approach and for some SVGs is you use a mask the SVG image does not show (this happens with the SVG icons supplied with the examples).
2) What can cause this different behaviour? I did not test yet, but I am assuming the bitmap blitted in case A) will not have any transparent areas as we are not using a mask.
3) Is there any new functionality in S60 5th edition to handle SVG images?
BR,
Rene




