×
Namespaces

Variants
Actions

Archived:Using createImage to mirror certain PNGs causes phone crash on S60 3rd Edition (Known Issue)

From Nokia Developer 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}}.

This known issue was originally created by Ed welch and has been verified by Nokia Developer.

Article Metadata
Tested with
Devices(s): All
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: ed_welch (03 Sep 2007)
Last edited: hamishwillee (30 Jul 2013)

Description

This problem only occurs with 8-bit PNG images with dimensions 31 x [an odd number of pixels] and have transparent pixels. It happens when you use Image.createImage to transform an image as follows:

  Image mirror = Image.createImage(image, 0, 0, 
image.getWidth(), image.getHeight(), Sprite.TRANS_MIRROR);
g.drawImage(mirror, 80, 80, Graphics.HCENTER|Graphics.TOP);

When you draw the image, it will be shown with the transparent pixels of the right-hand side replaced with white pixels. If you try drawing the image several times, the phone will eventually crash.

Solution

Do not use bitmaps with dimensions of 31 x [an odd number of pixels].

This page was last modified on 30 July 2013, at 11:12.
65 page views in the last 30 days.