How to save a drawn image in our own format

hai,
i'm developing a designing tool. in that user can draw any type of diagrams. i have to save the drawn image in my own extention... how can i do it. provide me some sample code if u can...

mituli wrote:
Thanks,
but I am using Image.getScaledImage() to get scaled image(obviously). This returns an Image object. When I call getGraphics() on this object it throws an exception:
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: getGraphics() not valid for images created with createImage(producer) at sun.awt.image.ToolkitImage.getGraphics(ToolkitImage.java:292)Try using createGraphics() instead.
In javadoc i found out that this method can be used only on off-screen image. What is off-screen image?Use BufferedImages, you'll have a lot less problems.
Anyway I can't use this object in ImageIO.write because it requires RenderedImage object which can only be BufferedImage object.
I tried to cast Image to BufferedImage but can't be ... If you need to get your Image painted onto a BufferedImage, you can do it like this:
BufferedImage bi = new BufferedImage(myImageWidth, myImageHeight, BufferedImage.TYPE_INT_RGB);
Graphics2D  g = bi.createGraphics();
g.drawImage(myImage, 0, 0, null);

Similar Messages

  • How to save applet in image(gif/jpeg) format

    Hi there !
    how to save applet in image (gif/jpeg) format. i have just gone through JIMI package where serilization is there ,WHERE U CAN SORE in image format ...........can anybudy help me out.........if possible then pleeez provide me some example.
    Thanks in advan...........

    I think that is possible because i have seen some commercial applets that do that.
    -http://www.izhuk.com/painter/
    -http://www.lawrencegoetz.com/programs/signature/
    Thses two saves the image in the server since applets cant write in the host they are running. Maybe it would be possible whit JFS, i don't know.
    For now I am trying to store an image draw in the applet on my server.
    My idea now is copying the image to a buffer or something, open a connection to the server and receive the image with a perl CGI.
    There is an example with text:
    -http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
    I want to do something similar but with an image.

  • Hello ! how to change document sizes and use our own size (not A3, A2 ...) thank you !

    hello ! how to change document sizes and use our own size (not A3, A2 ...) thank you !

    Experiment. No harm in trying.
    If you are just starting to use Pages you need to make your own assessment given current events whether committing your work to a format and software given this support is a wise move.
    You also need to look at what will produce workable results. Particularly if your large posters are to be commercially printed and contain large bitmap (photographic) images.
    Always work backwards from your output. Ask your printer what they require to do their job.
    Peter

  • HT2534 how can my daughter and i have our own itunes accounts on one computer because it automatically logs on with mine?

    how can my daughter and i have our own itunes accounts on one computer because it automatically logs in with mine?

    Hi theirmimi,
    Go to Manage your Apple ID (on a computer) and sign in with your Apple ID. Then you can edit the email information on your account:
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Cheers,
    GB

  • How can I put an image onto a postcard format?

    How can I put an image onto a postcard format?

    By postcard format do you mean crop the picture into a postcard shape?
    If so, here is one way: Activate the Rectangular Marque tool. Set Style to Fixed Aspect Ratio, and enter the dimensions for Width & Height. In this example I used a standard postcard size of 6" x 4.25".  Open your picture, draw out the rectangle, and Image > Crop. The picture will now be in the 6 x 4.25 proportion.
    To get it to the actual 6" x 4.25" size, do Image > Resize > Image Size. Check the Constrain Proportions Box, and enter either the true Width or Height; the other dimension will change accordingly.
    If this is not what you are trying to do, please be more specific.

  • How to save a photobook as pdf or jpeg format?

    how to save a photobook as pdf or jpeg format?

    Do you mean like a multi-page PDF?  As in, one photo per page? Or something else?
    You might get what you are looking for by exploring the options in iPhoto's Print (under the File menu) and then clicking the PDF button, and then Save As PDF.
    Without knowing more details about exactly what you are wanting to do, it's hard to know what else to suggest.

  • Displaying images in their own format.

    I wrote the following code to store a path of an image into a textbox:
    declare
    filename VARCHAR2(255);
    begin
    filename := GET_FILE_NAME(NULL,NULL,'All Files (*.*)|*.*|');
    :infiles.letterpath := filename;
    end;
    Then,
    I used the following code to read an image(bath) from "letterpath" textbox and display it into an image item:
    Read_image_file(:infiles.letterpath, 'gif', 'infiles.letter_image');
    Now, what i want is to show images in their own format, not to dispaly them into an image item.
    Can someone please tell me how i can display images in their own format.
    For example: lets say i store a path of a word document in a textbox then when i click an open button, i want that document to be displayed in MS Word.
    Thanks in advance.

    Hi,
    you could use an OLE container in Forms and associate this with the externmal viewer that you would like to show the source. This however works for c/s and immediately stops working once moving your app to the Web. There you would need to investigate in a Java Bean solution to do this.
    Frank

  • Anyone know how to Save an Java Image to gif or png file?

    I'm trying to build a Map Edito for game, I want to import some images which and a lot of tiles in each of them. I want to cut each tile 24x24 out, then save it in an invidual file.
    Anyone know how to save to file? any easy way?
    I know there is somehthing call JPEGEncoding to save into jpeg...
    thanks!

    Java Advanced Imaging does it nicely, take a look.
    I do not remember the extact syntax right now, but have used it in the past.

  • How to save a awt image in SVG file?

    hi all,
    Can anyone please tell me how to store a awt Image to an SVG file....
    For this i tried to change the awt image to outputstream, But I couldnt do that.
    As i am using some licensed software if i able to convert the awt image to output stream then my work will be done... can u please help me out in this..
    regards
    Mohanraj.K
    chennai

    javax.imageio API allows you to write/create a jpeg/png/bmp/wbmp ... image format. I don't think there's support for svg. you'll have to look for some third party plugin.
    Thanks,
    Kannan

  • How to save a background image on a mac?

    I want to save a background image on this webpage
    http://www.twitterbackgrounds.com/tiled-twitter-backgrounds
    when I used windows i would just rt click and save background and it would save only the background. when i do that with the mac it saves the whole page. can anyone help me. i can fine any help online. I am new to a mac. alexandra.

    HI,
    Go here and check out the bottom right side of the page.
    http://www.twitterbackgrounds.com/tiled-twitter-backgrounds
    Use their e-mail to ask if their images are Mac OS X friendly and if so which Mac OS X version.
    Please click My Settings right side of this page and tell us which Mac OS X your MacBook is running.
    Thanks! Your forum profile is important... it helps us to help you.
    Please do not post twice for the same topic.
    http://discussions.apple.com/message.jspa?messageID=10578998#10578998
    Carolyn

  • How to use Synchronized method when creating our own controls

    I don't know how to use the synchronized method when creating our own activex like controls to speed up the application.

    [url http://java.sun.com/docs/books/tutorial/essential/threads/multithreaded.html] here you go 

  • How to save a magnified image in Aperture or IPhoto

    How do I save an image that I have magnified in Aperture or I Photo?

    Product user wrote:
    and save is in file
    Could you post a screen-shot or otherwise verify this?  I've been using Aperture for several years, several hours a day — I'm an Aperture Certified Pro — and I have, to the best of my memory, never seen "File ▹ Save" in Aperture.

  • How do I create an image of our standard MacBook build?

    Hi,
    I've been set the job of creating a standard image for all our companies MacBooks. We currently have a build process, but this takes several hours for each MacBook and isn't very convienient.
    What I would like to do is install all the required software, configure all the settings, then take an image that we can deploy to all subsequent MacBooks.
    I know this is a pretty simple procedure for a Windows machine, but from my research, unless I'm missing something blindingly obvious, it doesn't seem to quite as simple on Macs.
    All our MacBooks currently run on Mountain Lion 10.8.5, we are unable to upgrade to Mavericks at the moment due to some support issues with disk encryption software.
    I am currently using a MacMini with Server installed 10.8.5.
    Can someone please offer me some advice?
    Cheers
    Dunk

    If you perceive the Windows procedure to be easy, then the Mac process will be a slice of cake and a bowl or cherries.  Cloning OS X is incredibly easy.  There are some gotchas when new hardware is released, but in general, it is cake.  There are many ways to do this.
    The easiest, is a disk image clone.  You have already figure out the steps.  Build a machine exactly the way you want it.  But don't personalize it in any way.  Don't bind it to the domain.  Don't create user accounts (other than admin), and remember to change the machine name to something the you will remember to change.  I tend to use CHANGEME.  Once you have the master image, the steps are basically:
    1:  Boot the master machine to its recovery partition or into target disk mode.
    2:  Use Disk Utility to create a disk image of the entire drive.  Compressed with no encryption is usually effective.
    3:  Save this to a drive other than the master drive.
    4:  When the capture is complete, go to the images menu in Disk Utility and run Scan Image for Restore on the disk image you've just created.
    5:  When done, use that disk image and the Restore tab of Disk Utility to restore back to other machines.  Once again, boot to the other machines recovery partition or build yourself a boot service drive.
    Now, beyond this, you can get into NetRestore (requires and OS X Server), or tools like JAMF.  You need more than 50 Macs for this to be cost effective.
    Imaging Macs is cake.  New SSD based units can be cloned in less than 10 minutes. 
    R-
    Apple Consultants Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available in the Apple iBooks Store

  • How to save transparent background images to have transparent background thumbnails with Photoshop 2014?

    In old versions of Photoshop there was a feature that made thumbnail images have a transparent background.  I'm a CC member using Photoshop 2014 on a MacBook Pro running OS X 10.9.4 and every thumbnail of a transparent background image I've created in Photoshop 2014 appears on my desktop with a solid white box background that has a thin black outlined box inside of it.  How do I save the transparent background images I've created in Photoshop 2014 so they will appear on my desktop as thumbnails with a transparent background?   I'd like to continue to be able to replace the default background-less folder icon that that appears on files with transparent background thumbnails to customize my files as I use to do with older versions of Photoshop.

    If your layered document has a Photoshop background layer it visibility need to be set off when saving a PNG or Gif file for Photoshop background layers do not support transparency.
    Thumbnail may be a bit more complicated than you think. I do not use Lightroom, and only occasionally use the bridge.  I believe Lightroom and Bridge  keep thumbnails they develop for image files  in their library databases and caches.  Other programs do not have acces to  these.  RAW Files and Image files have Jpeg previews stored in then.  I believe most application use these previews jpeg to create thumbnails.  Jpeg format does not support transparency.
    Icon on the desktop are not always thumbnails some are embedded icons in application modules other are icon in dll these may well have transparency. However image file on the desktop have generated thumbnails.  However you can create a shortcut for an image png file and create a icon with a transparent background for the png file and change the shortcut's icon for the png file to the transparent ico file you created for it.
    Also many Photoshop release ago an Adobe module created Thumbnails for image files in Windows File explorer and most likely system file dialog. Adobe stopped supporting that stating Microsoft changes how windows works.
    Today I use FastPictureViewer Codec Package to generate image thumbnails for image files including RAW and PSD files in File Explorer and system file dialogs.
    I don't use a Mac don't know what available for your Mac.

  • How to save incoming email images?

    I have a Mac desktop running on Lion OS X. When someone sends me an email with photo attachment, how do I save the photo? I tried right clicking the image and in the drop down box I am prompted to either Copy image or Save Attachment. I tried Copy Image but do not see how or where to Paste it (a la Windows). Actually I wanted to save it to a Picture folder in Adobe Lightroom. Will this work?

    Save the attachment (goes to your Downloads folder) and move it where you want.

Maybe you are looking for

  • Can i install mountain lion on my sony laptop?

    I am trying to know if I can install mac os on my sony laptop. I have mountain lion os.

  • Disk Utility: Creating a new blank image receiving "file too large" error.

    Hello All! I'm trying to create a 10GB non-encrypted, non-compressed RW blank image via the disk utility. The DU runs for a few minutes then barfs out "file too large" error. I have over 30GB free on my HDD. I tried with a smaller size of 6GB to no a

  • Archive Support Messages using SARA

    It is my understanding that the CRM message has to be archived using the archiving object CRM_SERORD in Transaction SARA. Does anyone have the detailed steps to correctly archive a CRM message within this transaction?

  • Access to Enterprise Services Repository (ESR)

    Hello, how can I access an ESR from a simple java console without having to use the Enterprise Services Builder? - Is there an API available? - Can somebody point me to a "best practice" for working with the ESR by using Java? Thx a lot!

  • Can't find  FORMS90_TIMEOUT key.

    Hi All , I'm running form10g on windows server 2003 OS , i want all the processes of Oracle Forms that has been aborted by users by clicking the X on the browser to be killed after 1 minute , i know that i have to set the FORMS90_TIMEOUT in the regis