×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: Save Image

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Thumbs up Save Image

    Hi,

    I want to save the image with the editable portion. That is i have added line and text on the image. I need to save the image including the text and line.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Save Image

    Hi,

    as far as I know, if you've got an Image object with J2me, there's no way to get raw byte data to save it somewhere. An alternative would be to get RGB data with getRGB() method and then recreate the image itself with createRGBImage().

    An (old) example on image serializing:

    http://developer.sonyericsson.com/si..._java_0502.jsp

    Hope it helps,
    Pit

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    Hi,

    If i recreate the image using createRGB() method then it is possible to save that image.

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Save Image

    Sure, you can recreate the Image with the RGB data got with getRGB().

    Pit

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    Hi

    Can u please explain in detail....

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Save Image

    A simple example:

    Code:
    Image original = Image.createImage(getClass().getResourceAsStream("/icon.png"));
    
    int width = original.getWidth();
    int height = original.getHeight();
    
    int[] rgbData = new int[width * height];
    
    original.getRGB(rgbData, 0, width, 0, 0, width, height);
    
    Image recreated = Image.createRGBImage(rgbData, width, height, true);
    Pit

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    Hi

    I have tried that code. Now i want to know where the image stored and how to read the stored image.

  8. #8
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Save Image

    You can store the image data using RMS or FileConnection APIs. You can find API references here:

    RMS: http://java.sun.com/javame/reference...e-summary.html

    FileConnection: http://www.forum.nokia.com/document/...B2A/index.html

    Pit

  9. #9
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    If i stored the png file in rms then i want to open the saved image and make some changes. Now i want to save the current image. It is possible?

  10. #10
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Save Image

    With RMS you can easily read/write data (check addRecord() and getRecord() methods)

    Pit

  11. #11
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    addRecord(),getRecord() using this method new record is added and readed. This is used for text format. Eventhough these methods used for image means then how the editable portion can save.

  12. #12
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Save Image

    I'm not sure I've understood your problem. Anyway, addRecord() and getRecord() methods work with byte[] data, so you can effectively store/read anything within RMS.

    Pit

  13. #13
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    Any other alternative available for saving image including the editable portion rather than rms and fileconnection.

  14. #14
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Save Image

    U might want to look into the JSR75 PDA Optional Packages for the J2ME Platform... Im not sure if its possible to write to a file instead of the RMS with this JSR but u might want to find that out...

  15. #15
    Registered User
    Join Date
    Apr 2008
    Posts
    43

    Re: Save Image

    Can anyone know how to save the image with editable portion.
    Please help me its urgent.

Similar Threads

  1. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  2. how to save image taken by camera with bitmap
    By winsys in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2006-10-10, 05:46
  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. Display, modify and save image
    By mazi888 in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2006-03-13, 20:14
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

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