are .PNG or .JPG images able to support mutable?
because when i tried importing a png image into my application
and when i check it using isMutable() method
it printed false.
i am using J2me netbeans btw.
Thanks
are .PNG or .JPG images able to support mutable?
because when i tried importing a png image into my application
and when i check it using isMutable() method
it printed false.
i am using J2me netbeans btw.
Thanks
Hi shirodas,
Well there is some confusion on your side..is that isMutable() returns that whether the image on which it isMutable() was called is mutable or not..However it does not return that whether that image was created as mutable or not..I hope this is clear..
You can read the java docs quote..
Please read carefully - Immutable definition -public boolean isMutable()
Check if this image is mutable. Mutable images can be modified by rendering to them through a Graphics object obtained from the getGraphics() method of this object.
Returns:
true if the image is mutable, false otherwise
and please read this also carefully - Mutable definition -Images are either mutable or immutable depending upon how they are created. Immutable images are generally created by loading image data from resource bundles, from files, or from the network. They may not be modified once created.
Mutable images are created as blank images containing only white pixels. The application may render on a mutable image by calling getGraphics() on the Image to obtain a Graphics object expressly for this purpose.
Note that -
I hope that these lines can make the things clear..An immutable image may be created from a mutable image through the use of the createImage method. It is possible to create a mutable copy of an immutable image using a technique similar to the following:
Thanks,
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,
if u could finish that last line it would be very helpfull
On how to make an mutable image out of a immutable one...
as far as I know u can create an immutable image (just a square of white pixels), call it's getGraphics method to opbtain Graphics g object, and then for example paint a immutable Image in it with g.drawImage...
the result is a mutable Image which contains an immutable one with possible extra's (like extra text on it)...
Thanks alot Raj.
you cleared up one big misunderstanding on my project
=D
means all the images i get from src folders are immutable.
ok get it
Hi,
Yeah the images those are loaded and created from resource folder are called as mutable images..and the images those are created by the mutable images are called as immutable images..
Hope this is fine and helpful,
Thanks,
Thanks with Regards,
R a j - The K e r n e l
Join Delhi-NCR Nokia Developer's Community,