Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Scaling a bitmap without preserving the aspect ratio may lead to application panic on S60 2nd Edition FP3 (Known Issue)

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.

Article Metadata
Platform(s): S60 2nd Edition, FP3, N70, N90
S60 2nd Edition FP3
S60 2nd Edition (initial release)
Created: User:Technical writer 1 (24 Nov 2005)
Last edited: hamishwillee (21 Jun 2012)



Using the CBitmapScaler::Scale() method with the aMaintainAspectRatio parameter set to EFalse may lead to application panic.


An application may terminate with USER 21 panic when a bitmap image (e.g., of size 132x176) is scaled (e.g., to 176x144) using the Scale method from CBitmapScaler with the aMaintainAspectRatio parameter set to EFalse.

How to reproduce

(See above)


If all that is needed is for the scaled image to be rendered on the screen, you can use the CGraphicContext::DrawBitmap method.
If the scaled bitmap is to be retained for further processing, the same method can be used to render the image on a CBitmapContext object and then keep the bitmap on which this was constructed. The following is a sample code for testing that can be integrated into the S60 Developer Platform 2.0: Image Converter Example application.

void CImageConverterEngine::ScaleL(TSize aSize)
CWsBitmap *newBitmap = new (ELeave)
CFbsBitmapDevice* bitDev =
CBitmapContext* bgc = NULL;
bgc->DrawBitmap(TRect(TPoint(0,0), aSize), iBitmap);
delete bgc;
CleanupStack::PopAndDestroy(2); // bitDev, newBitmap
delete iBitmap;
iBitmap = newBitmap;
This page was last modified on 21 June 2012, at 00:53.
43 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.