Android Alternative To Java.awt (bufferedimage And Raster)
Solution 1:
Sounds like you just want to work with bitmaps and be able to manipulate the pixels themselves in an array. The Bitmap
class comes to mind along with its getPixels
method. Remember though that you have much more limited memory on a mobile device. It's easy to run into out of memory problems when working with large bitmaps.
Another route would be to use the NDK. I don't have much experience there, but AndroidBitmap_lockPixels
and AndroidBitmap_unlockPixels
are probably a good place to start.
Lastly, yet another option that should perform pretty well is to use RenderScript.
If all you're looking to do is load an image into an int
array though, Bitmap.getPixels
should be quite sufficient.
Solution 2:
You can convert a BufferedImage
to a PNG or JPEG, then send it via HTTP to Android which can then convert the PNG or JPEG back to a Bitmap
and use it.
When Android needs to send any image, send it as PNG or JPEG via network, and then convert the PNG to BufferedImage
and use it in your program.
Post a Comment for "Android Alternative To Java.awt (bufferedimage And Raster)"