如何在程序中保存多张位图为MBM

来源:互联网 发布:人工智能技术体系架构 编辑:程序博客网 时间:2024/05/16 14:34

Try use this....

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

_LIT(KBMPFilePath0,"C://facebook.mbm");
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
=================================================================================
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.......
=======================================================================

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 );

原创粉丝点击