Anyway to save icon/image to file?

Hello,
The what:
I have a picture I made which I put in my resource files which is a ___.jpg. I want to save this picture in a word document so it actually shows the image with text incorporated in the file as well.
The how:
I tried ImageIO and Resource type file writers but nothing is writing how I like.
The question:
Is this even possible? If so what is the writer called?
Thanks,

If you want to create a word document, you might look into POI
[http://poi.apache.org/]

Similar Messages

  • How to save an image to file without rendering to screen?

    Does anyone know of a way I can save a buffered image to a file (as a jpg) without having to render it to a screen first? I can create the file fine if I place the image on a JPanel first. However when I try to save the image directly to a file, the program hangs when I try to render the image to a Graphics object. Is there some sort of initialisation carried out on the image when it is displayed on screen which I need to carry out to save the image offscreen?
    Just as a background, what I am trying to achieve is to create a chart (using Monarch Charts library) based on a supplied set of data, and then to save this chart as a jpg. It works fine if I first display the chart in a JPanel but not when I try to save it offscreen.
    Can anyone help me out here?
    Thanks,
    Ciaran

    Here's the code I use in JFreeChart to create a buffered image - the third line draws the chart using the Graphics2D obtained from the BufferedImage:
        public BufferedImage createBufferedImage(int width, int height) {
            BufferedImage image = new BufferedImage(width , height, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = image.createGraphics();
            this.draw(g2, new Rectangle2D.Double(0, 0, width, height), null);
            g2.dispose();
            return image;
        }Writing to a JPEG can be done like this (method taken from the ChartUtilities class in JFreeChart):
        public static void writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height)
            throws IOException {
            BufferedImage image = chart.createBufferedImage(width, height);
            JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
            JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image);
            param.setQuality(1.0f, true);
            encoder.encode(image, param);
        }If you want to try some running code, download JFreeChart from:
    http://www.object-refinery.com/jfreechart/index.html
    ...then run this application:
    package com.jrefinery.chart.demo;
    import java.io.File;
    import com.jrefinery.chart.JFreeChart;
    import com.jrefinery.chart.ChartFactory;
    import com.jrefinery.chart.ChartUtilities;
    import com.jrefinery.chart.demo.DemoDatasetFactory;
    import com.jrefinery.data.XYDataset;
    public class ChartToFile {
        public static void main(String[] args) {
            XYDataset data = DemoDatasetFactory.createTimeSeriesCollection2();
            JFreeChart chart = ChartFactory.createTimeSeriesChart("Sample Chart", "Time", "Rate", data, true);
            File file = new File("MyChart.jpg");
            try {
                ChartUtilities.saveChartAsJPEG(file, chart, 400, 300);
            catch (java.io.IOException e) {
                System.out.println(e.getMessage());
    }Regards,
    Dave Gilbert
    www.object-refinery.com

  • Ho i may save filtered image into file...?

    Image dst=panel.createImage(new FilteredImageSource(dst.getSource(),new AlphaFilter((jSlider1.getValue() * 255) / 9)));
    how i may save this into file?

    Object object=dst.getProperty("data", jTree1);
                //          iio..createImageInputStream(in);
                ImageInputStream iis;
              iis = (ImageInputStream) object;
                BufferedImage input= ImageIO.read(iis);i have this error Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Object cannot be cast to javax.imageio.stream.ImageInputStream

  • How to save output image after IMAQ-FFT to the file

    When I apply IMAQ FFT on monochromatic image and display complex destination image by IMAQ WindDraw, I get picture which I am not able to save to the file. I tried various conversions from complex image to bitmap (array), but result was everytime different from that got by IMAQ WindDraw.
    I thank for any help.

    Hallo Filip,
    you cannot save Complex Image to file to be readable by other programs - see link: http://digital.ni.com/public.nsf/websearch/D557B1A79C30AD5F86256AB1006A678A?OpenDocument
    What you can do is convert Complex Image to 8-bits BMP file format and save it then. This question was answered already - see example at: http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3ECED56A4E034080020E74861&p_node=DZ52000_US&p_source=External
    Hope this helps
    Pavel

  • Can load image from file using LabVIEW and display on IMAQ graph?

    I dont have IMAQ Vision for LabVIEW on my computer. Is it possible to load image file and display on an IMAQ graph?
    Thanks!

    Hey werwr,
    In response to: "I dont have IMAQ Vision for LabVIEW on my computer. Is it possible to load image file and display on an IMAQ graph?"
    As of right now, in order to read an image from file, you actually do need the IMAQ Vision software. The IMAQ driver without the Vision VI's will allow you to collect images from a framegrabber, and it will allow you to save those images to file. But the function that allows you to read an image from file does require the Vision VI's. Once you have the VI to read images from a file, you will be able to display the image on an IMAQ "Graph" or otherwise known as an Image Display.
    I hope this helps. Please let me know if you have any further questions.
    Thanks,
    DJ
    Applications Engineer
    National Instruments

  • How Do I get icons image directory to work in a JAR file?

    Yes, I must admit after going through the tutorial and other stuff I am stiil stumped
    I have an application that uses the jlfgr icons for the toolbar, and it works fine as long as i actually run it from the directory that it is in.
    I would like to put in into a jAr file, and be able to execute it from other places.
    I have a Directory named PhoneBook
    in that are the classes I use
    AddressBook - the main class
    PersonEntry - The 'data class'
    and various other things like FileFilters.....
    inside that directory there are two more:
    images - contains all the icon images
    Data - where the default 'database' entries are stored.
    I use code like this:
         private void fillToolBar( JToolBar bar )
              Dummy = new JButton(new ImageIcon("images/New16.gif"));
              Dummy.setActionCommand("New");
              Dummy.addActionListener(this);
              Dummy.setToolTipText("New");
              bar.add( Dummy );
              // etc etc
    to get all the icons into the toolbar
    I have made a Jar file that has all the classes and all the directorys with the icons in it
    and so the program runs, but does not get the icons for the toolbar, I just get a whole load of 'dud' buttons.....
    AS this is the first time i've ever got the GUI to look right rather than just the code functioning properly
    I'd like to get the whole thing in a working Jar file
    So Could someone show me Step By Step, How I get my classes and images into a Jar file
    so that i can from a different directory go
    java - jar Phone.jar
    and have the GUI come up with all the images, assuming I'm totally thickheaded when it comes to Jar files.?
    I also can't get the images to show up if I merely run the 'program' from another directory than the one it is compiled in
    I can get the program to run, just not access the images with something like
    java -cp blah/blah/blah AddressBook
    {the main class is AddressBook }
    the data directory can be anywhere as I use a JFileChooser to allow the user to open and save desired files.
    I really would appreciate some clear workable help. {though I'm running out of Duke Dollars...}

    What you need is a correct path to the directory
    inside of the jar. This can be accomplished by adding
    a line to your main program like this:
    URL
    url=myProgram.class.getResource("images/New16.gif");
    Dummy = new JButton(new ImageIcon(URL));
    where myProgram.class is the name of the class
    file that contain the main method.
    Hope this helps....
    ;o)
    PS: I don't want your dukes...I got them coming out of
    my ears!
    O.K, that works thank you.
    I put something like:
    for all the 'buttons' in the toolbar
    URL url = null;
    Class ThisClass = this.getClass();
    url=ThisClass.getResource("images/New16.gif");
    Dummy = new JButton(new ImageIcon(url));
    Dummy.setActionCommand("New");
    Dummy.addActionListener(this);
    Dummy.setToolTipText("New Database");
    bar.add( Dummy );
    etc for all the rest of the 'buttons'
    After Reading the API docs on URL's etc I'm still not sure as to why it works, but it does....
    I am able now to place the class files in a jar along with the images and it all works fine
    although now I don't quite follow all my code....................
    I assume that
    url=ThisClass.getResource("images/New16.gif");
    returns some sort of 'relative url ' ???
    Thanks for the help though.

  • Thumbnail images for file icons in finder windows

    Is there are way to automatically create thumbnails for images imported into iPhoto that will also appear in finder windows? When I save images in Photoshop, a thumbnail of the image is created and appears as the icon image of the file. However, when I import images from my camera or another storage device into iPhoto, only the generic JPEG icon appears in the finder window.
    Is there a shortcut to create thumbnails of image files that will appear in finder windows? Is there a way to batch create these thubmnails?

    WDW Duncan
    In any Finder window go View Menu -> Show View Options -> Show Icon Preview.
    Are you using this to try and find pics in the Finder? If so, it might help to know that there are three ways (at least) to get files from the iPhoto Window.
    1. Drag and Drop: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. File -> Export: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size.
    3. Show File: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    Regards
    TD

  • How to save an image as a PICT resource file?

    Can someone tell me how to save an image as a PICT resource file? I'd like to make ikons in Photoshop and save them in this format, but I 'm not finding any leads. Thanks!

    If you have Resorcerer from "ancient times" it of course can handle resource forks since that's was it's goal in life.
    There are lots of icon creation apps these days.  Do a search for "icon" on macupdate.com to see what's available.  For example that search finds:
    iconXprit
    Icon Builder X

  • How do I save specific image from a .tif file?

    Hello, I have a big .tif file contains some images. How can I save an image from a specific layer, to a .jpg or .png file?

    Hide the layers as deepakgahlot has suggested by selecting the eye icon on the layers pallet and then when you have the layer you want save for web (Shift+Ctrl+Alt+S) or File>Save for Web.. and then you can select either a .jpg or .png

  • When I try to same an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!

    When I try to save an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!
    == This happened ==
    Every time Firefox opened
    == I updated to one of the firefox versions (Not sure which one it was)

    Thanks Alex, but sadly I already tried that. Neither .docx or .xlsx files show up in the content list. They both show as a Chrome HTML document so changing how Firefox addresses those doesn't help since it thinks its the same type of file. I don't think I can manually add files into the "Content Type" left side nav.

  • Is there a way to save an image file as a jpeg and add -web or -print to the file name?

    I am trying to find a way to save my image file as a jpeg and add -web or -print to the existing file name.  This way I can easily see which files are lower resolution for web posting or high resolution for printing.

    Jason,
    I helped somebody do a very similar thing about a week ago.
    The trick is to use the Batch command's ability to construct a file name.
    Tell the batch to append, e.g. "-x" without quotes, to the name of each saved file.
    The batch runs an Action which does a save as JPEG, resize image, add logo, save as JPEG, then close document.
    The output is "<document name>-x.jpg" and "<document name>-x-x.jpeg".
    Then use Windows Explorer to rename "*-x-x.jpg" to "*-print.jpg".
    Then rename "*-x.jpg" to "*-web.jpg".
    See http://forums.adobe.com/thread/1038992?start=32
    The name construction that I used there was just an "x" appended to the document name. Use whatever you like. Also juliew subsequently referred to the method as a "double-batch" run, although it is not. One run of the batch will output two JPEGs for each input document.
    I hope the disagreements in that thread don't cause too much disruption.
    If you want, the Batch command itself can be recorded in another Action which would store the parameters of the batch, then you could run that Action anytime without having to set up the details of the batch each time. It would always output to one specific folder, though.

  • Save As Image fails with PDF files

    Using Acrobat X Pro, version 10.1.7. After the most recent update, I can no longer crop a PDF file and save it in any image format. The options are there, but when I select File > Save As > Image > PNG (or JPG or any other image format) and enter the filename/location, no new file is created.
    This is about to become an emergency, since a big annual production project uses images from PDF files as illustrations in other documents.
    Any ideas?
    Elisa

    I have had the same issue but with Acrobat 7 standard.  No error message is displayed however no file appears when trying to save a pdf as JPG  or other imgae formats.  Repairing and re-installing has not helped.  Did you make any progress with this issue?
    Strangely if a different user logs onto the same machine they can do this with no problems.  I have tried to find something in the users profile which could be causing this but with no sucess.

  • How to save uploaded image file to Apache Web Server from Tomcat

    Hi guys,
    Perhaps this is not an appropriate topic to ask under this forum but I really don't know where should I post my question. Hope you understand.
    Ok, I need to know if my web application is running in Tomcat5 and user uploading some image file where I need to save these image files to the other server, which is running Apache Web Server. Should I ftp to there or other better method ?
    Anyone got a better idea on doing this kind of process pls advice. Many Thanks !
    regards,
    Mark

    if your Apache server is running in the same computer and if your servlet have write access to the folder in apache under which you want to save the file you can just write the file there but you will have to address concurrency issues.
    Otherwise you will have to do ftp but since apache does not have abuilt in frp server you will need a seperate FTP server for this

  • Drag an image to the desktop saves as a bmp file

    dragging an image from a webpage to Windows Explorer or compliant program (xplorer2 or Zoner, or FastStone Image or desktop etc) saves as a .bmp file (mostly!). Invariably *.bmp files are large files and since the original format would be jpg or png I have to convert back to these formats.

    It’s the single worst feature of Firefox Mozilla.
    What the point of having private browsing if this is going on.
    You find the files in (user name)/appdata/local/temp
    its a hidden folder. when i looked i 3gigs of bmp files
    that not cool at all!! gerrrrrrrrrrrrrrr

  • Save byte array (image) to file with servlet

    Good day.
    I should must to save a png image to file.
    I have a byte array of the image.
    This work is in a servlet.
    How can I do it?
    Best regards.
    Stefano Errani

    Good day.
    I have a byte[] and then I have used
    FileOutputStream fos = new FileOutputStream(getServletContext().getRealPath("/public_html/mcfoto/foto1.png"));
    fos.write(bt, 0, bt.length); // byte[] bt
    fos.close();
    This on my web server that has public_html as root web directory.
    The server is in multi domain.
    In this mode I have an error.
    Then I have tryied to use
    FileOutputStream fos = new FileOutputStream("http://www.stefanoerrani.it/mcfoto/foto1.png");
    and
    FileOutputStream fos = new FileOutputStream(getServletContext().getRealPath("http://www.stefanoerrani.it/mcfoto/foto1.png"));
    In both ways I have obtained an error.
    At last I have tryied in my localhost (local machine) using
    FileOutputStream fos = new FileOutputStream(getServletContext().getRealPath("/mcfoto/foto1.png"));
    All run correclty.
    The Application Server is Tomcat with Apache HTTP Server.
    The first server (of www.stefanoerrani.it) has Linux as OS.
    My local server has Windows as OS.
    I should want, if it's possible, an help.
    Best regards.
    Stefano Errani

Maybe you are looking for

  • Is there any way to change the in-browser PDF software?

    After upgrading to mountain lion, the in-browser PDF software changed to Adobe. I have been trying to figure out a way to change it back to preview for quite some time now. My reason for wanting it changed back is that the Adobe software is very slow

  • The requested object does not exist. (Exception from HRESULT: 0x80010114)

    Hello, I have a 3 node cluster that is setup as active, active, passive.  Two of the nodes report the following error when trying to connect to the cluster: One of the active nodes is successfully able to connect the "Cluster" while the other two are

  • Lost contacts, restored from a backup and now lost all photos

    My wifes iphone 4s just lost all her contacts out of the blue. I tried to restore her contacts from a old backup and now she has lost a LOT of VERY important photos that were saved on her phone. Photos for her collage final "capstone" project before

  • IPhoto not recognizing RAW files

    I have a Canon t2i (550d) and have taken photo's in RAW mode... however neither iPhoto of Aperture seem to recognize this type of file (.cr2, a canon type of raw file).. it seems to be supported by other camera's.. is anyone else experiencing this ,

  • How to Make Wage Types Available in Drop Down

    Hi, I need to make a particular wage type available for a particular Infotype(14,15 to be precise.). I tried entering using the v_t512z maintenance. In that when I entered (actually copied from an existing WT), it gave an error that key already exist