Discussion Board
How to convert PNG to bitmap???
2004-05-05, 11:19
#1
Registered User
I'am trying to convert a PNG to a bitmap but it crashes everytime I open the apps???
I don't know what wrong?
Here is my code:
void CPNGContainer::ConstructL(const TRect& /*aRect*/)
{
CreateWindowL();
SetExtentToWholeScreen();
ActivateL();
iImageBits = new (ELeave) CFbsBitmap();
iConverter = CMdaImageFileToBitmapUtility::NewL(*this);
iConverter->OpenL(KPicFileName);
}
void CPNGContainer::Draw(const TRect& /*aRect*/) const
{
CWindowGc& gc = SystemGc();
gc.Clear(Rect());
gc.BitBlt(Rect().iTl,iImageBits);
}
void CPNGContainer::MiuoOpenComplete(TInt /*aError*/)
{
TFrameInfo frameInfo;
iConverter->FrameInfo(0, frameInfo);
err = iImageBits->Create(frameInfo.iOverallSizeInPixels,EColor4K);
TRAPD(convertErr,iConverter->ConvertL(*iImageBits));
}
void CPNGContainer::MiuoConvertComplete(TInt aError)
{
delete iImageBits;
iImageBits = NULL;
}
void CPNGContainer::MiuoCreateComplete(TInt aError)
{ /* no implementation */ }
Please Help!!! I just can't figure out what wrong with this.... I've been trying to figure out this for a whole day now and I'm just getting frustrated... : (
Any help will do! if you could also explain it....
Super Contributor
where exactly it crashes? Have you tried to debug it? What is in KPicFileName?
Registered User
Never mind I already figured it out, it's in draw that was having problem!
Thanks any ways!!!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules