07-28-2009 08:57 AM
Does anyone know how I could copy out a part of a bitmap?
BB does it already. You can see it if you look at plazmic Kit resources.
For instance, Radio strength indicator is an multiset png file, and when the strength changes, different part of a larger (mulitset) bitmap is displayed.
I tried doing something like that but run into a problem of converting a png to a byte (as can be seen on some forum threads, this is not very intuitive)
Currently I am stuck with the approach of loading the png through InputStreamReader.
But wouldn't it be simpler to reuse the (already loaded) Bitmap and just copy out the requested part ?
Has anyone have a deeper look into this ?
Solved! Go to Solution.
07-28-2009 12:08 PM
I'm not sure if I understand entirely what you mean, but you can use
public void drawBitmap(int x, int y, int width, int height, Bitmap bitmap, int left, int top)
In this case, your bitmap would be the entire large image, and you'd use width, height, left, and top to paint only the portion of that bitmap that you want.