Problem about Image....

I want to read image file(like Sample.jpg) and trasform to one half size and save to another file.
code:
Image img=Toolkit.getDefaultToolkit().getImage("./Sample.png");
Image img2=img.getScaledInstance(100,100,SCALE_FAST);
then I can draw image2....
but I wan to save image2 to a file(like Sample2.png)...
How can I do it....
Can Image class be transfered to byte array?
Anyway ,my question is how to save a image class to a file in my disk,not only can show it in applet.I want a really file.
Or in Java solution ,how can I do something changed(like resize)with a PNG(GIF..etc) file and save it to another PNG file.
               

sorry..I found the last 3 topic is the same as my question
.I know how to do it now....But does anyone knows how to save as PNG file.I only can save as JPG or GIF file.Because J2ME only read PNG file,so plz tell me where can I find PNG encoder and decoder.

Similar Messages

  • Is this a bug of Outlook 2007 about images displaying in signature?

    I've done many tests and researched on website or MS KB. But still got no solution.
    My issue is:
    I make a signature with images linking from website which can be easily accessed.
    I setup this signature in Outlook 2007, when I compose a new mail, and choose the signature I set. It won't show the images with a high percentage rate, meanwhile, I try to get into "Signature"-"Signature...", 
    Outlook2007 gets stuck, then you can not close Outlook or open Internet Explorer unless you kill the process of OUTLOOK.exe.
    1. Test are done under a clean XP system and Office 2007 standard fresh installed. Also there are some other staffs who help me test the signature that report the same issue on Office 2007.
    2. Images are rendered in 96dpi. They are all in very small size stored on website, can be easily accessed without network connctivity problem.
    3. The signature is made by simple HTML language not by Outlook signature setup wizard. but in this case,  you can ignore which method I use to create the signature. The images in signature can be displayed well in Outlook 2003 &
    2010. Also I have tried insert images using "link to file" in Outlook signature setup wizard, got same issue.
    4. Don't suggest me to store the images locally. These images should be updated after a period. You can not ask the company staffs to update these images manually by themselves. and even if the images are stored locally, the images won't be shown
    in Outlook 2007 with a high percentage rate.
    5. I've tried setup signature with or without an account profile, got same issue.
    6. I 've tried without an accout profile, just copy the signature file to Outlook signature folder, unplug the network cable, and "new mail" then load the signature, of course, the images won't be shown because network connection doesn't exist,
    and then when I try to get into "Signature"-"Signature...",  the Outlook interface also gets stuck. So I think Outlook 2007 may have some problem on detecting the network connectivity.
    7. It is not possible to upgrate the version of Office. Since Office 2007 isn't out of date and is powerful enough for us, no one want to pay more money just to avoid this issue.
    I don't know why I cannot upload a screenshot for troubleshooting. If needed. I can send a mail with screenshot attached.
    So far to now, I still get no solution, I think this is a bug of Outlook 2007, because the same signature, there is no problem on Outlook 2003 & 2010. Hope someone of MS staff can see this article and report to technical support center.
    I would appriciate anyone's kindly help but please consider that you understand what I am talking about. I don't want to waste time for each of us.
    thanks in advanced.

    What kind of problem about the display image in signature?
    How do you add the image into the message body when you send the message?
    Does it show correct through Web-based access?
    Outlook 2007 doesn't support some of Style Element, you may reference the link as below:
    http://www.campaignmonitor.com/css/
    Thanks.
    Tony Chen
    TechNet Community Support
    Thanks for your reply,  I know that some Style Elements won't be supported in Outlook, but this is not the reason.
    Please refer to my post previously, I post it but get no response.
    http://social.technet.microsoft.com/Forums/office/en-US/481170b1-f23f-4d46-9914-823326491846/is-this-a-bug-of-outlook-2007-about-images-displaying-in-signature?forum=outlook

  • Problem with Image.createImage()

    Hi all!
    I'm writing a simple midlet just to display an image on the screen and I'm having some problems with Image.createImage()
    Here is my code
    Image bg_img;
    ImageItem imageItem1;
    imageItem1 = new ImageItem("", null,ImageItem.LAYOUT_DEFAULT, "");
    try{
    bg_img = Image.createImage("/image.png");
    imageItem1.setImage(bg_img);
    catch(java.io.IOException e){
    e.printStackTrace();
    I'm getting an exception on bg_img = Image.createImage("/image.png");
    I can't understand what is it...:(
    I know for sure that the problem is not "file not found"
    Any one can help me???

    If you are catching IOException, then u may have problem with ur image path. "image not found on the specified path." if ur image is not in the current directiry then put it into current directory. otherwise, If u are using resouce folder and it is already included into the resouce path, then put ur image in that folder..try this..
    Still not get, then please give some detail about ur development toolkit. and ur apllication packaging scheem. are you using ANT?
    Pranav

  • Problems with images in ibooks author

    I got a problem about edit images in iBooks author:
    Here is my problem:
    I want to make the image zoom into full screen when it was tapped on the iPad. How should I do this?
    I need your help, please tell me if you got some experience about this. Appreciate it!

    You don't have to do anything special for this. Make your images 1024 x 768. A tap on an image will expand it to full screen.
    Michi.

  • Problems w/ Images in Reports 2.5

    I seem to have run into an apparent limitation with the Oracle Developer
    2000 Report Designer 2.5. I have an image that is displayed, the path being
    stored within the database, the image is then Read from file. This works
    fine except there are two problems that I have run into and hope somebody
    can either confirm this is the way the software functions or point me in the
    right direction.
    It seems impossible to me to get the image to center within the field as
    defined in the Report Layout. I have the image field on the report set to
    about 10 Inches wide. Initially the image appeared on the left hand side of
    the field, I changed the alignment to Center as you would for a text field
    but to no avail, the image always comes back on the left hand side.
    If the images where all of a uniform size this would not bother me as I
    would simply create the image box based upon the size of the image and
    center it on the report, alas this is not an ideal world. How can I center
    an image within a field ? Is it even possible.
    Thing brings me onto my second problem, the images stretch to fill the image
    field, stopping when it either hits the horizontal or vertical boundary.
    This is great in a way because oversized images are zoomed into and appear
    fine, the whole process does not mess with the aspect ratio's of the images
    at all. However with images much smaller than the image field, they are
    stretch way to much and become pixilated and an eyesore. I have tried
    playing with the Variable, Can Shrink, Can Grow features but I lose all
    control of where the image will wind up with varying results. The Expand,
    Contract properties have little effect, the variable option shrinks all
    images down to the tiniest of thumbnails and then again they appear to the
    left of center. Somebody has to have done this before.
    Any idea how I can control this behavior ? And maybe just have an image
    appear at its actual size ?
    Combined these two factors make the report shabby, and this is intended as
    presentation quality material.
    Any guidance, advice is appreciated.
    Thanks,
    James
    James Starritt
    null

    Hello,
    Is there any particular reason you cannot upgrade to Reports 6i? Reports 2.5 is quite old, and there have been a number of issues resolved with images since then.
    Regards,
    The Oracle Reports Team --skw                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Experiencing problem with image display in LR5

    I have an intermittent problem with images displaying and exporting in LR. It just began a couple of months ago and is totally random - will do it with RAW (CR2) or JPG. It displays this way in all modules - Library, Develop, Slideshow....The image displays fine in a non-Adobe image viewer (Faststone or Windows Viewer). I've reloaded LR5 and PSCC and is still persists. I know the image file is fine. It also has begun effecting older images that were showing up just fine a while ago. I just loaded about 200 images and maybe 3 or so have this viewing problem in LR & PS. Has anyone else experienced it and have a suggested fix? My graphics card has the latest drivers and shows no problems with other applications. Here is the same image - one a jpg export from Lighroom, the other a save as jpg from Faststone. HELP!

    This is almost always a hardware problem, causing corruption of the file. The difference you see between Lightroom and other software is that Lightroom is accessing the full RAW image, while the other software is trying to read the embedded JPG preview.
    To figure out exactly what hardware is the problem, you need to try different transmission paths and hardware ... different camera cards, different card readers or USB cables/USB ports, different hard disks, etc. Eventually you should be able to isolate the problem.

  • Problem with image rotation. Images are distorted.

    Here is the story:
    I import images. Some of the need to be rotated because the camera not always records rotation properly. So I rotate them in LR. Everything is fine so far. But when I want to edit the rotated file in PS (CS2) problems arise.
    Either LR does not send information about image rotation or PS does not recognize it. The image opens in PS as it was initially shot so in order to work on it properly I need to rotate it in PS again. When I return to LR the thumbnail looks fine but the develop module stretches or distorts the image.
    As far as I remember I dodn't have such a problem a week ago so what could be the cause?

    I am also having this problem, again using Jpegs. If I Right click in LR and choose "Edit Original" in Photoshop CS, the photo appears correctly oriented in PS. I edit it (in this case using PTLens to remove distortion and then cropping) and save the file.
    LR now displays it correctly in the Library module, but stretched in the Develop Module. The edges of the image and the grey pinstripe around it also flash grey a couple of times a second while displaying stretched.
    I tried reading metadata from file, and this deleted all my LR edits (not just ratings etc) to the file but didn't fix the problem.
    Any more ideas? This doesn't happen if I edit a copy of the original file, but don't really want to duplicate all images shot on a wide angle lens. Is this something in the way PS CS re-writes the orientation information to a jpeg, or how LR reads it?
    Sam

  • Problems selecting images in LR4

    I've been having problems selecting images in the library module when multiple images are in view (not down in the timeline, but in the main window). It seems sporadic with which ones it won't let me select, it somehow manages to be the ones that I need to click....!! I just literally can't click it as if it were an image I already imported or something, but it's not grayed out like that. I've been having to select a nearby image then use my arrow keys to navigate to and click the image I need. Any ideas about what is happening? Thanks so much for any ideas, it's really strange and just started last night.

    There was a bug forever-ago that certain areas of the screen simply didn't respond to any clicks.  I think the solution was to rebuild the preferences file.  Does that sound like the same issue perhaps?

  • Problem to image HP DC5850

    Hi everyone....
    I have a problem to image an HP DC5850 computer.
    I have Zenworks 7 running in SLES 9 with the last patches for Zenworks 7 and the December 2008 drivers update.
    When i try a PXE boot or with a CD, i have this error:
    Could not find Zenworks Installation source.
    Someone have an idea?

    stevev,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Problem with Image file

    Hi,
    Iam facing with one problem.I have one swing interface through which I can upload files(back end servlet programme).Now I can upload all types of file but problem with image file it uploading perfectly that means size of the uploaded file is ok but its format damaged.It can not be open.My backend servlet programme is ok coz i tested it with html form it is working perfectly.Problem with swing interface.Plz guide me where I done a mistake.Below r my codes:-
    ImageIcon Upload=new ImageIcon("images/Upload.gif");
         Button=new JButton(Upload);
         Button.setToolTipText("Upload");
    Button.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
              int returnVal = fc.showOpenDialog(ActionDemo4.this);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              File file = fc.getSelectedFile();
    String aa=file.getAbsolutePath();
              textArea3.append(aa);
                   textArea2.append("Local URL:");
    long l=file.length();
              try
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff);
              String str1=textArea10.getText();
    url = new URL ("http://127.0.0.1:7001/servletUpload?x="+str1);
         urlConn = url.openConnection();
         urlConn.setDoInput (true);
         urlConn.setDoOutput (true);
         urlConn.setUseCaches (false);
         urlConn.setRequestProperty("Content-Type","multipart/form-data;boundry=-----------------------------7d11e410e500f2");
         printout = new DataOutputStream (urlConn.getOutputStream ());
    String content ="-----------------------------7d11e410e500f2\r\n"+"Content-Disposition: form-data;"+"name=\"upload\"; filename=\""+aa+"\"\r\n"+"Content-Type: application/octet-strem\r\n\r\n\r\n"+conffile+"-----------------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);
    printout.flush ();
    printout.close ();
    Best Regards
    Bikash

    The errors are here:
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff); (conffile is a String object containing the image)
    and here:
    String content ="-----------------------------7d11e410e500f2\r\n"+"Con
    ent-Disposition: form-data;"+"name=\"upload\";
    filename=\""+aa+"\"\r\n"+"Content-Type:
    application/octet-strem\r\n\r\n\r\n"+conffile+"--------
    --------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);conffie is sent to the server but
    it's non possible to treat binary data as String!
    Image files must be sent as byte[] NOT as String ......

  • An old and difficult problem about "UnsatisfiedLinkError"

    Hi dear all,
    I have been struck with the problem about "UnsatisfiedLinkError". I have a c++ class HelloWorld with a method hello(), and I want to call it from within a java class. In fact, I have succeeded in calling it on the windows platform. But when I transfer it to linux, the error "UnsatisfiedLinkError" comes out. I have tried to take the measures as Forum has suggested, but it failed.
    The source code is very simple to demonstrate JNI.
    "HelloWorld.h"
    #ifndef INCLUDEDHELLOWORLD_H
    #define INCLUDEDHELLOWORLD_H
    class HelloWorld
    public:
    void hello();
    #endif
    "HelloWorld.cpp"
    #include <iostream>
    #include "HelloWorld.h"
    using namespace std;
    void HelloWorld::hello()
    cout << "Hello, World!" << endl;
    "JHelloWorld.java"
    public class JHelloWorld
    public native void hello();
    static
    System.loadLibrary("hellolib");
    public static void main(String[] argv)
    JHelloWorld hw = new JHelloWorld();
    hw.hello();
    "JHelloWorld.cpp"
    #include <iostream>
    #include <jni.h>
    #include "HelloWorld.h"
    #include "JHelloWorld.h"
    JNIEXPORT void JNICALL Java_JHelloWorld_hello (JNIEnv * env, jobject obj)
    HelloWorld hw;
    hw.hello();
    All the files are in the same directory and all the processes are under the dirctory:
    1. javac JHelloWorld.java
    2. javah -classpath . JHelloWorld
    3. g++ -c -I/usr/java/jdk1.3/include -I/usr/java/jdk1.3/include/linux JHelloWorld.cpp HelloWorld.cpp
    4. ld -shared -o hellolib.so *.o
    5. java -cp . -Djava.library.path=. JHelloWorld
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no hellolib in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1349)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at JHelloWorld.<clinit>(JHelloWorld.java:7)
    Tried another measure:
    i) export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
    ii)java -cp . JHelloWorld
    The same error came out as above.
    I really don't know what is wrong with it.
    Would you like to help me as soon as possible?
    Thanks.
    Regards,
    Johnson

    Hi Fabio,
    Thanks a lot for your help.
    It is very kind of you.
    Regards,
    Johnson

  • A problem about calling Labview vi in VB

    Hi all:
    I meeting a problem about data transfer and parallel operation between VB and Labview.
    Actually, I want develop a VB program, in which, the Labview VI can be called and corresponding parameters can be transferred to Labview. and then, I also can operate my system by VB program at same time. something like parallel operation (VB and Labview program).
     But the question is :
    1.   If I use "Call" method of ActiveX in VB,  and the LabVIEW subvi is not stopped (for example, a loop structure), I can not do  parallel operation on VB program. The error message is "other application is busy" which is attached below. The sample codes is also attached.
    2.   I tried to use other methods like "OpenFrontPanel" and "Run", but I am not sure how to transfer the parameter??
    3.  Then I tried to use "SetControlValue" to set the parameters, but there is a error " := expected", which is very strange, because the statement  I wrote is followed with the help documents [ eg: VI.SetControlValue ("string", value)], why it is still need a "=" ??
    Does anybody know something about it? Thanks a lot
    Message Edited by hanwei on 11-07-2008 03:18 PM
    Attachments:
    vb_labview_error_message_1.JPG ‏14 KB
    VB_to_LV.zip ‏10 KB

    I sure hope OP has solved it by now.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • HT201210 hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    hi everyone, i have a problem about my iphone 4S, doesn't work with wifi connection and bluetooth since upgrade to the IOS 7.0.3. Can anyone can help me tosolve this problem?????Thank's regards paulus

    Try the suggestions here to see if they resolve your problem:
    http://support.apple.com/kb/ts1559
    If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.

  • Problem about Handling of Empty Files in File Adapter

    Hello everyone,
    NetWeaver 2004s --- XI
    In Sender i have a File Adapter.
    Now i meet a problem about Handling of Empty Files. When i send empty file, but don't cerate a leer message.
    I have seen following text in help document. But in adapter configuration i can not find the correspond parameter.
    can you give me some tips?
    Thx in advance
    best regards
    Yaning
    SAP Help Document über File Adapter
    +Handling of Empty Files
    Specify how empty files (length 0 bytes) are to be handled.
    &#9675;       Do Not Create Message
    No XI messages are created from empty files.
    The files are processed according to the selected Processing Mode.
    For example, if the processing mode is Delete, empty files are deleted in the source directory.
    &#9675;       Process Empty Files
    XI messages are created with an empty main payload.
    The files are processed according to the selected Processing Mode.
    &#9675;       Skip Empty Files
    No XI messages are created from empty files.
    Empty files are skipped and remain in the source directory.+
    Help Docu

    hi,
    it's available since Sp19 for XI 3.0
    and the corresponding SPS fpr XI 7.0
    http://help.sap.com/saphelp_nw04/helpdata/en/44/f565854b7341e6e10000000a1553f6/frameset.htm
    so probably you need to install the new SP
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Problem about sales order stock stock transfer and batch determination

    Hi, experts, I get a problem about sales order stock stock transfer and batch determination.The following is the current situation of my system:
      In OMCG I assigned search procedure ME0001 to both 311 and 311 E and ticked check batch. After that, I found  that if iI need to tranfer unrestricted-use material from storage location 1000 to 2000 with movement type 311, I just need to input * at the field batch, then the system will display all of the available batches. But for the transferring of sales order stock with movement type 311 E, after I input * at the batch field, no batch is displayed and there is also no message from the system.
      Can anybody help me? Is there anything else I need to do? Thanks very much.

    I think my question is not clear, actually I tried 562 E , 411 E and 413 already. all the transaction looking for the sales order but unfortunatly the sales order is deleted  from SAP.

Maybe you are looking for

  • Windows 8.1 Standard with Microsoft Account does not work with WSE 2012

    I have a WSE 2012 machine with 3 users & 3 devices setup. My Windows 8 (Standard) Laptop with Local User connects fine. My Windows 8.1 (Standard) Nettop with Local User connects fine. But my Windows 8.1 (Standard) Laptop with a Microsoft Account does

  • Error joining the selected airport network?

    I'm trying to connect to my linksys wireless using WPA with a powerbook but no luck. My password which I know is correct (it's working on another G4 and my wife's Gateway. I get the following message when selected my network. "There was an error join

  • How to center text in Pages to show correctly on iBook Reader

    Hi, First, I have to say that I posted the same question on ''Creating ePubs'' discussioun page but nobody could help. I am trying something really easy but could not solve it. Hope someone can help. Ok, I know that if I choose ''Chapte Name'' as a p

  • Upgrade GAP Analysis from 4.7 to ECC 6.0

    Hi Gurus !!! Does any one have any material regarding GAPs between 4.7 to 6.0 ? I am more interested on SD GAPs My email is [email protected] Thx. in advance. Marco

  • Linking subreport and primary report

    Post Author: ScottBarnard CA Forum: General I'm having trouble linking a field from a primary report to the same field in the subreport.I've followed all the steps outlined in the help section. When I preview the report I get a parameter prompt for t