08-05-2011 07:16 PM
I am trying ot scale images depending on the screen resolution. However the Bitmap quality using scaleImage32 is noticeably bad.
I am unable to use scaleInto since we need to support OS versions prior to 5.0.
Is there a way to get better quality scaled images on OS versions prior to 5.0?
08-06-2011 01:37 PM
You could try the ImageManipulator Library that you find here:
I think it does its scaling using drawTexturedPath() which might be better.
08-07-2011 03:41 PM
I tried the ImageManipulator on a 350 x 350 pixel PNG graphics (not a photo) to scale it to 50 x 50 pixels and the performance is really bad. In fact the ImageManipulator.scale(Bitmap, scale) never returned.
I made sure that I specify scale as Fixed32 value.
08-08-2011 02:30 PM
I tried ImageManipulator as well. But the quality is similar to scaleImage32. The ImageManipulator library just uses placeholder for different interpolation algorithms (BI_LINEAR, LANCZOS etc.) but does not implement them.
I implemented bi-linear interpolation and the results are acceptable. I will stil have to test if the performance is acceptable on actual devices.
08-08-2011 02:33 PM
Use this, I found it yesterday:
It works a treat. Now I can scale my images on the device without loosing quality or transparency. RIM should take this algorithm and implemented in OS 7 with native GPU support to make it really fast too.
The speed of the function now is ok. Just don't load to many images at app start up.
08-08-2011 02:47 PM
Maybe, but hand on your heart: all the devices that still run 4.6 and can't be upgraded to 5.0 have such low res screens, you don't need good image quality there ;-)
But seriously: I have stopped bothering with 4.6. 5.0 is now the minimum for my apps. 7.0 is ante portas. So it's time to cut legacy and move on.