08-04-2012 10:35 AM
Does anybody know why my image2 does not get scaled in the image2.scaleImage32() method?
public ZoomScreen setScreen(){
map1.getBitmap().scaleInto(tempBmp, Bitmap.FILTER_BILINEAR);
Graphics g = Graphics.create(tempBmp); //works
g.drawBitmap(100, 100, bitmapImage2.getWidth(), bitmapImage2.getHeight(), bitmapImage2, 0, 0); //works
image2 = PNGEncodedImage.encode(tempBmp); //works
image3 = image2.scaleImage32(Fixed32.toFP(100), Fixed32.toFP(200)); // does not work
ZoomScreen screen = new ZoomScreen(image3);// works
return screen;
}
Solved! Go to Solution.
08-04-2012 12:38 PM - edited 08-04-2012 12:38 PM
So what does happen?
What size do you get and what size do you expect?
I am wondering if you are reading the API incorrectly. Note that the values you supply to scaleImage32 are scaling factors, not the target pixel sizes.
08-04-2012 04:22 PM
I get the 100x100 size but I want 400x300 for example
08-04-2012 07:54 PM
So why can't you change the scaling to get the size you want?
08-05-2012 05:58 AM
exactly ![]()
08-05-2012 06:30 AM
So you always get 100 x 100 regardless of what scaling numbers you try? What numbers have you tried and what are the results?
08-05-2012 06:35 AM
I tried 1000x800 and stuff like that.. the result is always same. Although can it be possible that the image resizes but when it's made larger, that it only gets drawn on a bigger canvas in the same resolution instead of getting enlarged?
08-06-2012 01:36 AM
08-06-2012 05:22 AM
Just to add to what CMY has pointed out, you said:
"bigger canvas in the same resolution "
Remember that resolution is actually not relevant on a Blackberry. It only has so many pixels to display. So a large canvas means more pixels and so a bigger image, a smaller canvas means fewer pixels and so a smaller image.
The only time that resolution becomes important is when considering how large the Bitmap will look on the device's screen. On something like a 8520 and 320 x 240 image will fill the screen, on a 9860 it won't of course.