Hello, I wrote this without trying to compile -> some mistakes stille there :-)
Code:
class YourPicture
{
public:
YourPicture (CFbsBitmap* aBitmap, TPtrC* aName)
{
iBitmap = aBitmap;
iName = aName;
}
~YourPicture ()
{
delete iBitmap;
delete iName;
}
CFbsBitmap* iBitmap;
TPtrC* iName;
};
class YourContainer
{
<...>
RPointerArray<YourPicture> iPictures;
CFbsBitmap* iPictureInDecryption;
}
[.cpp]
TPtrC imagesTable[] = {
_L("pict001.jpg"),
_L("pict002.jpg"),
_L("pict003.jpg"),
_L("pict004.jpg")
};
CYourContainer::CYourContainer()
: iPictureInDecryption (NULL)
{
}
CYourContainer::~CYourContainer()
{
iPictures.ResetAndDestroy();
iPictures.Close();
}
void CYourContainer::Start()
{
iConverter->OpenL(imagesTable[iPicInProgress]);
}
void CYourContainer::MiuoOpenComplete(TInt aError)
{
// TODO: Check aError
TFrameInfo frameInfo;
iConverter->FrameInfo(KFrameIndex,frameInfo);
iPictureInDecryption = new(ELeave)CFbsBitmap;
TInt err = iConverter->Create (frameInfo.iOverallSizeInPixels,iEikonEnv->SystemGc().Device()->DisplayMode ());
if( err == KErrNone )
{
TRAP(err, iConverter->ConvertL(*iPictureInDecryption));
}
else
{
MiuoConvertComplete(err);
}
}
void CYourContainer::MiuoConvertComplete(TInt aError)
{
switch (aError)
{
case KErrNone:
{
YourPicture* newItem = new(ELeave)YourPicture(iPictureInDecryption, iImages[iPicInProgress]);
User::LeaveIfError (iPictures.Insert(newItem,iPictures.Count() ));
}
default:
{
iConverter->Close();
return;
}
break;
}
if (++iPicInProgress <= (sizeof(imagesTable) / sizeof(TPtrC)))
{
Start();
}
}
<...>
iPictures.Count() // Total count of pictures available.
iPictures[0]->aBitmap; // CFbsBitmap pointer of pict001.jpg
iPictures[0]->aName; // TPtrC (name) of pict001.jpg
Br V.