Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 22:09, 13 December 2007.

Efficient way of Loading Bitmap and Mask in S60

From Forum Nokia Wiki

_LIT(KYourMifFile, “resource\\apps\\yourmif.mif”);

//yourmif.mif contains svgs

include <yourmif.mbg>  in  .cpp file

// In header file

CFbsBitmap* iFocusBitmap;
CFbsBitmap* iBitmapMask;

// anywhere in .cpp file

if(iFocusBitmap == NULL)
{         
   // load the image and mask
   AknIconUtils::CreateIconL( iFocusBitmap,
                              iBitmapMask,
                              KYourMifFile, 
                              EMbmYourMif_focus,
                              EMbmYourMif_mask );
}
TSize  size(Rect().Width()*10/100,Rect().Height()*10/100); 
AknIconUtils::SetSize(iFocusBitmap,size,EAspectRatioNotPreserved);
AknIconUtils::SetSize(iBitmapMask,size,EAspectRatioNotPreserved );
 
 //  In the  destructor
 
<code>
delete  iFocusBitmap;
delete  iBitmapMask;


AknIconUtils::SetSize initializes the icon to the given size, if the parameter aBitmap is an instance of CAknBitmap, i.e.created with AknIconUtils methods. If it is not CAknBitmap, this method does nothing. Note that this call sets the sizes of both bitmap and mask (if it exists), regardless of which is given as the parameter. Note Without a call to SetSize Bitmap will not be drawn and seen on the screen

Although CreateIconL have overloaded method for creating only the single bitmap rather than its mask but this has been more efficient interms of size and loading

Related Discussions
Thread Thread Starter Forum Replies Last Post
listbox icons s60 Symbian User Interface 3 2007-02-20 00:53
Shows splash screen when loading. fishman8 Symbian User Interface 7 2008-04-04 19:17
YUV capture from camera igorek74 Symbian Media (Graphics & Sounds) 7 2008-04-28 10:42
Maximum Size of CFbsBitmap for NOKIA N-Gage niton General Symbian C++ 17 2003-07-14 09:33
loading picture joby_nk General Symbian C++ 16 2007-09-19 05:43
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX