Forums Register Login

How to scale an image in J2ME?

+Pie Number of slices to send: Send
Does anyone has any idea how to scale an image in J2ME?
Does Graphics class and Image class provide any method to support the implementation of image scaling?
+Pie Number of slices to send: Send
No. The phone only has 100 KB of heap memory. Why would you waste it on oversized images? You should probably resize and optimize your images offline and then bundle them your application.
+Pie Number of slices to send: Send
I could think of a few cases where you might want to scale down an image that was acquired on a camera phone using the MMAPI, for example in order to generate a thumbnail. In fact, I am working on such an application right now. The following article points out a simple way to do this:
http://developers.sun.com/techtopics/mobility/midp/articles/picture/
Check out the createThumbnail() example. In theory, this solution is not ideal, but it works fine for this purpose on my Nokia 3650.
With regards to scaling up you would need some real interpolation algorithm, so this would be more tricky. I'm not sure why anyone wouln need to do this, though.
Otherwise, I completely concur with Michael that you should do the scaling before and package the scaled images with your app.
-Mirko
+Pie Number of slices to send: Send
I could think of a few cases where you might want to scale down an image that was acquired on a camera phone using the MMAPI, for example in order to generate a thumbnail. In fact, I am working on such an application right now. The following article points out a simple way to do this:
Link
Check out the createThumbnail() example. In theory, this solution is not ideal, but it works fine for this purpose on my Nokia 3650.
With regards to scaling up you would need some real interpolation algorithm, so this would be more tricky. I'm not sure why anyone wouln need to do this, though.
Otherwise, I completely concur with Michael that you should do the scaling before and package the scaled images with your app.
-Mirko
+Pie Number of slices to send: Send
Someone needs to write a PNG parser and manipulation program for MIDP!
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1526 times.
Similar Threads
getRGB method
displaying image in the midlet
Image scaling in J2ME
skin screen size (emulator)
Encryption with Midlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:04:57.