×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    31

    Questions about Mutable image

    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

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: Questions about Mutable image

    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..

    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
    Please read carefully - Immutable 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.
    and please read this also carefully - Mutable definition -

    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 -
    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:
    I hope that these lines can make the things clear..
    Thanks,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Questions about Mutable image

    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)...

  4. #4
    Registered User
    Join Date
    Nov 2008
    Posts
    31

    Re: Questions about Mutable image

    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

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Questions about Mutable image

    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,

Similar Threads

  1. problem in display an image button on canvas(Background image)
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-11-12, 04:51
  2. Image or Sprite, thats the problem
    By Tiger79 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2007-10-02, 08:59
  3. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  4. Create imutable image from mutable causes Exception
    By rikard_wigforss@hotmail.com in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2004-07-19, 09:04
  5. NokiaUI: getPixels() from a mutable Image
    By xdimas in forum Mobile Java General
    Replies: 0
    Last Post: 2002-11-13, 07:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×