Awt.image writing to mysql

I am trying to write an Image datatype to a mysql database. The problem is that all the tutorials and books tell you how to do this directly from a file then get a filestream etc etc.
I am working on the server side of a system so the image wont have come from that system. Therefore i can not give a filename or a path. HOW to i get the image to write to the database in its current state?
thanks

Is there anyway to get the ImageIcon or Image
datatypes into a form where they could be written to
the database? Is there a way even to convert back
from
Image image; to File file?Assuming that you are using javax.swing.ImageIcon:
This class is serializable:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/ImageIcon.html
http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html
http://java.sun.com/docs/books/tutorial/essential/io/serialization.html
Therefore, you could serilize the object which turns it into a stream of bytes and save it to the database using what I mentioned in my previous post and unserialize it to get it back to its original state. There are some possible issues because serializing objects in not really intended for long term storage (versions change, etc.).
There is also XML object storage - you should find an article about it if you search this site.

Similar Messages

  • Sun.awt.image.ToolkitImage

    Hi
    I'm integrating with a 3rd party package which delivers various images.
    These come in different objects, mostly BASE64DecoderStream and BufferedImage. But, GIF files are delivered as a ToolkitImage object.
    For the BufferedImage I do something like
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    ImageIO.write(image, "JPG", stream);and puts it in DB. I just can't figure out a way to do the same for ToolkitImage.
    My questions are:
    1. Is there a way to convert/cast the ToolkitImage so i can format/encode it and put it in DB, similar to the example above?
    2. Where is the API documentation for the internal classes in package "sun.awt.image"?
    Hope you experts can help me out here :)

    > Didn't know it could be casted to an Image.
    Do you know of any documentation on sun.awt.image in general?
    Why Developers Should Not Write Programs That Call 'sun' Packages
    The classes that Sun includes with the Java 2 SDK, Standard Edition, fall into package groups java.*, javax.*, org.* and sun.*. All but the sun.* packages are a standard part of the Java platform and will be supported into the future. In general, packages such as sun.*, that are outside of the Java platform, can be different across OS platforms (Solaris, Windows, Linux, Macintosh, etc.) and can change at any time without notice with SDK versions (1.2, 1.2.1, 1.2.3, etc). Programs that contain direct calls to the sun.* packages are not 100% Pure Java. In other words:
    The java.*, javax.* and org.* packages documented in the Java 2 Platform Standard Edition API Specification make up the official, supported, public interface.
    If a Java program directly calls only API in these packages, it will operate on all Java-compatible platforms, regardless of the underlying OS platform.
    The sun.* packages are not part of the supported, public interface.
    A Java program that directly calls into sun.* packages is not guaranteed to work on all Java-compatible platforms. In fact, such a program is not guaranteed to work even in future versions on the same platform.
    For these reasons, there is no documentation available for the sun.* classes. Platform-independence is one of the great advantages of developing in the Java programming language. Furthermore, Sun and our licensees of Java technology are committed to maintaining backward compatibility of the APIs for future versions of the Java platform. (Except for code that relies on serious bugs that we later fix.) This means that once your program is written, the class files will work in future releases.
    Each company that implements the Java platform will do so in their own private way. The classes in sun.* are present in the SDK to support the Sun implementation of the Java platform: the sun.* classes are what make the Java platform classes work "under the covers" for the Sun Java 2 SDK. These classes will not in general be present on another vendor's Java platform. If your Java program asks for a class "sun.package.Foo" by name, it may fail with ClassNotFoundError, and you will have lost a major advantage of developing in Java.
    Technically, nothing prevents your program from calling into sun.* by name. From one release to another, these classes may be removed, or they may be moved from one package to another, and it's fairly likely that their interface (method names and signatures) will change. (From the Sun point of view, since we are committed to maintaining the Java platform, we need to be able to change sun.* to refine and enhance the platform.) In this case, even if you are willing to run only on the Sun implementation, you run the risk of a new version of the implementation breaking your program.
    In general, writing java programs that rely on sun.* is risky: they are not portable, and are not supported.
    ~

  • Useless code in java.awt.image.SampleModel.java?

    Hey there,
    i just looked up the sourcecode of java.awt.image.SampleModel.java in JDK 6
    I discovered two issues i'd like to discuss.
    1) on lines 736 to 739 this code is stated:
    if (iArray != null)
    pixels = iArray;
    else
    pixels = new int[numBands * w * h];
    I asked myself, why does this code exist? while the getPixels() method is overwritten twice by double[] getPixels() and float[] getPixels, it is impossible to reach the part of the java code that initializes the pixels-array. One could only step into that line if "null" is given for the i/d/fArray-parameter. but if one would do so, the Java parser couldn't determine, which method is to use. so this part of code is just useless IMHO.
    the java developers could get a little more performance out of this method if the if statement would be cut out - especially when reading a lot of very small rasters
    or, on the other hand, they could replace this piece of code by an explicit bounds check.
    When somebody touches this code, i would appreciate it if the errormessage "index out of bounds!" could be rewritten to be a little more verbose, like: Index out of bounds(x=123; y=456, maxX=100, maxY=400)!(numbers are just examples)
    I hope i didn't miss something very basic and could help improving this class a little bit.
    2) the local variable Offset(line 734) is coded against code conventions which say, variables shall start with a lowercase letter. Offset obviously doesn't fit that convention.
    best regards
    kdot

    One could only step into that line if "null" is given for the i/d/fArray-parameter. but if one would do so, the Java parser couldn't determine, which method is to use. so this part of code is just useless IMHO. You can have
    sampleModel.getPixels(x,y,w,h,(int[]) null, dataBuffer);No ambiguity on which method to use.
    the local variable Offset(line 734) is coded against code conventions which say, variables shall start with a lowercase letter. Offset obviously doesn't fit that convention. You're correct, offset is against coding conventions. So are many other examples scattered throughout the jdk source code. For example, Hashtable should be called HashTable. In some cases the coding conventions might not have been established when the original code was written. In other cases it might have been human error. In yet other cases the conventions were probably ignored. The person who wrote the SampleModel class did so some 10+ years ago (Java 1.2). Who knows what he/she was thinking at the time, and in all honesty - does it really matter in this case?
    Did you know there are some classes that declare unused local variables (ahem ColorConvertOp)? Some also have unused imports ( *** cough *** BufferedImage *** cough *** ). In essence, the jdk source code is not the epidemy of code correctness. But it's still pretty good.

  • OutOfMemory error in java.awt.image.DataBufferInt. init

    We have an applet application that performs Print Preview of the images in the canvas. The images are like a network of entities (it has pictures of the entities involve (let's say Person) and how it links to other entities). We are using IE to launch the applet.
    We set min heap space to 128MB, JVM max heap space to 256MB, java plugin max heap space to 256MB using the Control Panel > Java.
    When the canvas width is about 54860 and height is 1644 and perform Print Preview, it thows an OutOfMemoryError in java.awt.image.DataBufferInt.<int>, hence, the Print Preview page is not shown. The complete stack trace (and logs) is as follows:
    Width: 54860 H: 1644
    Max heap: 254 # using Runtime.getRuntime().maxMemory()
    javaplugin.maxHeapSize: 256M # using System.getProperties("javaplugin.maxHeapSize")
    n page x n page : 1x1
    Exception in thread "AWT-EventQueue-2" java.lang.OutOfMemoryError: Java heap space
         at java.awt.image.DataBufferInt.<init>(Unknown Source)
         at java.awt.image.Raster.createPackedRaster(Unknown Source)
         at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
         at java.awt.image.BufferedImage.<init>(Unknown Source)
         at com.azeus.gdi.chart.GDIChart.preparePreview(GDIChart.java:731)
         at com.azeus.gdi.chart.GDIChart.getPreview(GDIChart.java:893)
         at com.azeus.gdi.ui.GDIUserInterface.printPreviewOp(GDIUserInterface.java:1526)
         at com.azeus.gdi.ui.GDIUserInterface$21.actionPerformed(GDIUserInterface.java:1438)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Drilling down the cause of the problem. The OutOfMemory occurred in the constructor of DataBufferInt when it tried to create an int array:
    public DataBufferInt(int size) {
    super(STABLE, TYPE_INT, size);
    data = new int[size]; # this part produce out of memory error when size = width X height
    bankdata = new int[1][];
    bankdata[0] = data;
    The OutOfMemory error occurred when size is width * height (54860 X 1644) which is 90,189,840 bytes (~86MB).
    I can replicate the OutOfMemory error when initiating an int array using a test class when it uses the default max heap space but if I increase the heap space to 256MB, it cannot be replicated in the test class.
    Using a smaller width and height with product not exceeding 64MB, the applet can perform Print Preview successfully.
    Given this, I think the java applet is not using the value assigned in javaplugin.maxHeapSize to set the max heap space, hence, it still uses the default max heap size and throws OutOfMemory in int array when size exceeds the default max heap space which is 64MB.
    For additional information, below is some of the java properties (when press S in java applet console):
    browser = sun.plugin
    browser.vendor = Sun Microsystems, Inc.
    browser.version = 1.1
    java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
    java.awt.printerjob = sun.awt.windows.WPrinterJob
    java.class.path = C:\PROGRA~1\Java\jre6\classes
    java.class.version = 50.0
    java.class.version.applet = true
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.6.0_17-b04
    java.specification.version = 1.6
    java.vendor.applet = true
    java.version = 1.6.0_17
    java.version.applet = true
    javaplugin.maxHeapSpace = 256M
    javaplugin.nodotversion = 160_17
    javaplugin.version = 1.6.0_17
    javaplugin.vm.options = -Xms128M -Djavaplugin.maxHeapSpace=256M -Xmx256m -Xms128M
    javawebstart.version = javaws-1.6.0_17
    Kindly advise if this is a bug in JRE or wrong setting. If wrong setting, please advise on the proper way to set the heap space to prevent OutOfMemory in initializing int array.
    Thanks a lot.
    Edited by: rei_xanther on Jun 28, 2010 12:01 AM
    Edited by: rei_xanther on Jun 28, 2010 12:37 AM

    rei_xanther wrote:
    ..But the maximum value of the int data type is 2,147,483,647. That is the maximum positive integer value that can be stored in (the 4 bytes of) a signed int, but..
    ..The value that I passed in the int array size is only 90,189,840...its only connection with RAM is that each int requires 4 bytes of memory to hold it.
    new int[size] -- size is 90,189,840Sure. So the number of bytes required to hold those 90,189,840 ints is 360,759,360.
    I assumed that one element in the int array is 1 byte. ..Your assumption is wrong. How could it be possible to store 32 bits (4 bytes) in 8 bits (1 byte)? (a)
    a) Short of some clever compression algorithm applied to the data.

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • 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

  • Point me in the right direction: want to resize image & store in mysql db

    I finally accomplished one of my tasks! Which was trying to upload a jpeg image into my mysql database, and then display it in a jsp page via a servlet. I extend my thanks to the java forums greatly:)
    Now my next task I find is going to be trickier to accomplish, because I do not have enough experience working with images.
    I would like to make my first task above more efficient.
    When the user selects a jpeg file to send, I want to check the size of the image and resize it as well, before finally storing it in my Mysql database.
    I do not want to lose the resolution, nor do I want it to look distorted after it is resized. I want to keep the same proportions as the original image (I hope that proportion is the proper term). After the image is stored successfully, it will be read out of the database and displayed within a jsp page via a servlet.
    After poking around in the forums, I realized I need to get down the basics with regards to getting the properties of an image and trying to resize it. It doesn't look like it will be an easy task.
    Does anyone know of any sites that provide a good, easy to understand tutorial? Or are there any books you would recommend I read? What Java classes should I be looking into to accomplish my task?
    There are so many far more experienced programmers out there among the forums, that when I look at their code, I'm lost. I just want to understand this process better, by taking it one step at a time.
    Any help is appreciated, as always:)
    Thank You,
    Love2Java

    Load image with ImageIO
    Call getWidth() and getHeight()
    Create a BufferedImage with width and height scaled accordingly
    Get the image's Graphics2D object
    Call drawImage(), passing an AffineTransform to scale accordingly
    Output the image via ImageIO
    That should be it - you just need to read the APIs for the classes I've mentioned, and tack on whatever input/output streams you need at either end (see the java.io package).
    The only thing is:
    I do not want to lose the resolution
    Not totally sure what you mean: if you're scaling the image down to a thumbnail then by definition you're losing resolution. If you mean you want to keep the DPI resolution metadata in the image then you'll have to Google for it, the information is there but it hasn't remained in my head :o)
    But then I can't imagine why you'd need DPI metadata in a thumbnail anyway, so you can probably ignore it.

  • Image upload in mysql Databse is working fine of IE bt not in Firefox?

    i hav developed an application of image upload in mysql database,it is working good in Internet Explorer but showing exception of " java.io.FileNotFoundException: (The system cannot find the file specified)" in Mozilla Firefox.
    i'm sending my java servlet code here ,please help me out.
    * uploadData.java
    * Created on July 17, 2008, 12:11 PM
    import java.io.*;
    import java.sql.*;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.PreparedStatement;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.sql.rowset.serial.SerialBlob;
    public class uploadData extends HttpServlet {
    String mysql_driver = null;
    String mysql_url=null;
    String mysql_pwd=null;
    ServletConfig servletConfig;
    Connection con=null;
    ResultSet rs=null;
    PreparedStatement pstmt=null;
    FileInputStream fis=null;
    String currentYear;
    String nextYear;
    String letterNo;
    String currentAmount;
    String actualExpenditure;
    String fp;
    public void init(ServletConfig config) throws ServletException {
    servletConfig = config;
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    ServletContext context= servletConfig.getServletContext();
    fp=request.getParameter("uploadfile");
    currentYear=request.getParameter("currentYear");
    nextYear=request.getParameter("nextYear");
    letterNo=request.getParameter("letterNo");
    currentAmount=request.getParameter("currentAmount");
    actualExpenditure=request.getParameter("actualExpenditure");
    HttpSession session=request.getSession();
    String userName = (String) session.getAttribute("User");
    String institute = (String) session.getAttribute("inst");
    mysql_driver =context.getInitParameter("jdbcdriver");
    mysql_url=context.getInitParameter("jdbcurl");
    mysql_pwd=context.getInitParameter("password");
    mysql_url=mysql_url + "&" + mysql_pwd;
    try {
    fis=new FileInputStream(fp);
    byte b[]=new byte[fis.available()];
    fis.read(b);
    fis.close();
    Blob blob=new SerialBlob(b);
    Class.forName(mysql_driver).newInstance();
    con=DriverManager.getConnection(mysql_url);
    String query="insert into uploads (FILENAME,BINARYFILE,user_id,nameOrganization,currentYear,nextYear,letterNo,currentAmount,actualExpenditure) values (?,?,?,?,?,?,?,?,?)";
    pstmt=con.prepareStatement(query);
    pstmt.setString(1,fp);
    pstmt.setBlob(2,blob);
    pstmt.setString(3,userName);
    pstmt.setString(4,institute);
    pstmt.setString(5,currentYear);
    pstmt.setString(6,nextYear);
    pstmt.setString(7,letterNo);
    pstmt.setString(8,currentAmount);
    pstmt.setString(9,actualExpenditure);
    out.print("-----------"+query);
    //pstmt.executeUpdate();
    int i=pstmt.executeUpdate();
    if(i>0)
    out.println("Image Stored in the Database");
    else
    out.println("Failed");
    } catch (Exception ex) {
    out.print("*******************"+ex);
    ex.printStackTrace();
    out.close();
    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    // </editor-fold>
    in variable " fp " in IE it is showing complete path of image but in firefox only name of image.
    please help me.......
    Thanks in Advance.

    thanks for your help,
    i had also tried this application by taking help from javazoom.upload, using multipart request,
    but that is was working fine,but the problem with that was i not only hav to upload a file in the same page i also have to save other textbox value (parameters).
    i have used 2-3 solutions to upload but the main prblm coming in my way is to save other information apart from uploaded file.
    with that MultipartRequest i'm unable to save all those information  to mysql database.
    thats why i used this way.
    Note give me hint so that solution can work on both Explorer.
    one more thing please tell me ,will this work on remote server ,as our site is hosted from other place ,we do't hav permission to access (in case of absolute path).
    please help me out............where i'm going wrong.
    thankx

  • Best way to update images using PHP / MySQL?

    HI
    I want to update images using PHP/MySQL, so users can update their images and maybe some other files but mainly images.
    thanks

    How messed up is this code?!
    <?php
    //connect to database
    $con = mysql_connect("testhost","testuser","pass");
    // file properies
    $file = $_FILES['image']['tmp_name'];
    if (!isset($file))
    echo "please select an image";
    else {
        $id = $_REQUEST['id_display'];
        $image = ($_FILES['image']['tmp_name']) ? file_get_contents ($_FILES['image']['tmp_name']) : '';
        $image_name = ($_FILES['image']['name']) ? addslashes($_FILES['image']['name']): '';
        $image_size = ($_FILES['image']['tmp_name']) ? getimagesize($_FILES['image']['tmp_name']): '';
        if ($image_size == FALSE)
        echo "You have not selected an image.";
        else {
            mysql_select_db("test_display", $con);
            mysql_query("UPDATE testtable SET image = '$image', imagename = '$image_name' WHERE id_display='$id'");
    ?>
    And the upload page....
    /*Update code */ /*End update code */                            

  • Java.io.NotSerializableException: sun.awt.image.BufferedImageGraphics2D

    Hi all!
    This problem is in relation to a very complex bean for data visualization which is jarred and bridged as an activex control.
    I am able to create the activex control and embed it in a vb form. But when I try to run the application in vb I get the following message and the application does not start.
    java.io.NotSerializableException: sun.awt.image.BufferedImageGraphics2D The bean has not used the class mentioned above anywhere. It uses the
    Image
    class though. I have used other beans, which use the same drawing techniques as the bean in question, as activex controls, with no errors.
    What could be the problem?
    tia
    Shailesh
    PS: the actual error dump is 1 page long I can send it by email on request.

    Hello,
    Have you implemented the Serializable Interface? I usually receive that error when I forgot to implement that interface. It is mandatory for a JavaBean to implement this interface.
    As an example:
    import java.io.Serializable;
    public class SimpleBean implements Serializable
    I hope it helps.
    Antonio Castro

  • Save an Image in a MySQL database

    I am trying to save an image in a MySQL database. This is what I have done so far; I have created a table with one of the variables called
    photo  blob, this is what you use to save an image right?
    When I write the image to the database after getting connected to it is where I am stuck, so far I can save Ints, Strings and Enum s values but I do not know how to convert my image into a Blob and save the blob. I have been doing some light reading and I am guessing I have to convert the image into a Stream of some sort. What type of stream I do not know. This is the java command I have to save the Blob but do not know what to use as the variable for the Blob.
    prst.setBlob(5,  "??????");As you can tell by the ????? marks, I do not know how to convert my image into the proper data type(whatever the data type is?) to save the contents into the database.
    If somebody has the exact copy of the all the java coded steps that is needed to save an image as a Blob into a prepared database, that would be extremelu helpful to me.
    Thank-you.

    The answer has to be quite simple. If you do not have
    the answer please do not reply.Unfortunately it's not simple. This is one of my betes noire about the java libaries. The Blob stuff has gaping holes in it. There's no method, anywhere, to create a new Blob or Clob (also the design of the Blob and Clob interfaces tends to miss the point).
    The ways arround this, there being no legitimate approach, vary with the database provider.
    If the program an the server are running on the same machine (or files can be shared through NFS or the like) you can try the "LOAD_FILE" function.
    With some databases I believe setBinaryStream instead of setBlob works, but I'm not sure the mySql driver is that smart.

  • Where is sun.awt.image.Image in Java5?

    Hello,
    I'm trying to compile a package using Java 5, which was before compiled with 1.4. I geth the error "sun.awt.image.Image cannot be resolved or is not a valid superclass".
    I found that class in 1.4.2, but not in 1.5. Is there an substitution for that?
    Regards,
    Kai

    Look in:
    java.awt.Image and java.awt.image for your needs and remember the sun.* packages are not guarenteed to be supported or be the same from version to version.

  • Saving images in a mysql db?

    Hi you all,
    I have a question.
    I'm working on a school project. And I was wondering if it is possible to save an image to a MySQL db with java.
    I would like to save an specified image to the database, but I'm also wondering is I could display the image from the database again (I prefere that there is no temp file created).
    (I have done this before with PHP)
    Does anyone has ideas or sample codes for me?
    Please hurry, I have only short time to finish the project.
    With Kind Regards,
    Franck Nijhof
    (ps sorry my bad english)

    I know that file in system is better. But in out project we must be saving a binary file in the database. A image is not that big and can be used usefull.
    So I like to do an image instead of an big program.
    (BTW I need it anyway, we need to build the program multiuser with network, this mean one is loading the image and everybody need to get it if they want to)
    Hopefully some can help!
    With kind regards,
    Franck Nijhof

  • Question : Save AWT Image Class to File..

    I Have a Question.. @.@a
    I'm doing AWT transform now..
    Well...
    I have a problem..
    I want to save AWT Image class to file..
    But.. I don't now that..
    Input Image Class same below..
    Image imageContent = (Image)attachment.getContent();
    How does it save imageContent Image class to file..?

    I had the same problem... convert it to a BufferedImage (http://forum.java.sun.com/thread.jspa?threadID=665744&tstart=15), then use javax.imageio.ImageIO.write to save it to a file.

  • Where to download  "sun.awt.image.codec.JPEGImageDecoderImpl"/Windows

    Hello,
    I bought some Java API. These API uses com/sun/image/codec/jpeg/JPEGCodec.
    I found these clases in src.zip in java install directory.
    Then, this code has a source line
    "import sun.awt.image.codec.JPEGImageDecoderImpl;"
    Where can I find/downlad this class?
    (I work on Windows platform)

    This class is in rt.jar package
    which is in ur jre directory/lib
    Hope u got it!!
    Pradhip

Maybe you are looking for

  • Remove Bridge Favorite that no longer exist?

    In CS2 Bridge, How do I remove a "favorite" from the favorite menu if the favorite folder does no longer exist. The "remove from favorite menu" command does not show up when a non existent folder is selected. I have all these folders that were delete

  • Creating a Variable Library XML "Database"

    So, I have been playing with the variable data options and have a couple of questions (in an attempt to wrap my head around the problem): - Is it possible to output an 'XML dataset' from a database program (such as FileMaker) and have it be 'correct'

  • How to host multiple websites?

    I have done this with Tiger and Leopard, but with OS X Server there is something I am missing. I have one website mydomain.com running on port 80 with the files at /Library/webserver/documents. I also have my mydomain,com running on port 443 with the

  • When I connect my iphone to my Mac it does not appear in itunes and wont sync.

    When I connect my iphone to my Mac the iphoto app opens and nothing else happens! When I open Itunes (or even finder) the phone is not recognized at all and does not appear. I can't sync anything. Help!

  • KisMac passive on a macbook pro

    does anyone know how to run kismac in passive mode on a macbook pro or can recommend any wireless cards i can buy to do this, thanks