PDA

View Full Version : how to use CFbsBitmap::StoreL


sunny_singh
2005-12-28, 10:02
hi,
i want to store images in MBM file and, i was suggested to use this fuction.
CFbsBitmap::StoreL

in sdk i read this,

static void StoreL(const TDesC& aFilename,TInt aNumSources,const TDesC* aSources[],TInt32 aSourceIds[]);

i couldn't get how to use the last parameters and what the last one mean

const TDesC* aSources[]- An array of pointers to bitmaps to be stored.
TInt32 aSourceIds[]- An array of identifiers for the bitmaps to be stored.

can anyone help me

thanks
synny

hemanthnarayanan
2006-05-23, 06:57
hi,
In the MBM concept, for each bitmap inside the MBM file u will be having a specific ID or ENum that will be used to identify that particular bitmap inside the MBM. I suppose that is the last parameter that u were talking about.
and the one before that was an array of pointers where each pointer should be pointing to a bitmap that u want to store inside the MBM. think this is what u were asking.
with regards,
Hemanth.

giridharn
2006-05-23, 07:11
hi,
Sunny...

u shd do it as this way.......

1.convert imgs to bmp and save them as .mbm using func CFbsbitmap.. saveL()
2.get this path into some buffer and pass them to TDesC* aSources[],
3.for TInt32 aSourceIds[] u can use any ids its ur wish..i used zeros for allimgs..

4.call this storel() function ur mbm is ready to use now...

hope this will help u in creating ur mbm files.......

bye
Giridhar.N

sunny_singh
2006-05-23, 12:21
hi,
thanks to both of you

but it is too late. if u see the date i posted it about five months back. i have already done it. but maybe it would help others who read this post.

thanks
sunny

kadriansyah
2009-06-16, 09:22
Try use this....

_LIT(KMbmFile,"C:\\result.mbm");

_LIT(KBMPFilePath0,"C:\\facebook.mbm");
_LIT(KBMPFilePath1,"C:\\balance.mbm");

TInt32* uniqueIds = new ( ELeave ) TInt32[ 2 ];
CleanupStack::PushL( uniqueIds );
uniqueIds[ 0 ] = 0;
uniqueIds[ 1 ] = 0;

TFileName** filenames = new ( ELeave ) TFileName*[ 2 ];
CleanupStack::PushL( filenames );
filenames[ 0 ] = new (ELeave) TFileName( KBMPFilePath0 );
filenames[ 1 ] = new (ELeave) TFileName( KBMPFilePath1 );

CFbsBitmap::StoreL( KMbmFile, // Filename for new multi-bitmap mbm
2, // Count of files
( const TDesC** )filenames, // bitmaps to be loaded
uniqueIds ); // id's of the bitmaps in MBM files

// Clean resources
delete filenames[ 0 ];
delete filenames[ 1 ];

CleanupStack::PopAndDestroy( filenames );
CleanupStack::PopAndDestroy( uniqueIds );