Need to save the image saved in the System Clipboard in using JDK 1.3.1

Does anyone know how to use JDK 1.3.1 to take an image saved in the System clipboard and save it to a file using the JPG format?
I know how it is done in JDK 1.4 using the following code. Unfortunately, the same code does not recognize the image in the clipboard in JDK 1.3.1
I am using jai-1_1_2_01.
package clipboard;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
import java.awt.image.RenderedImage;
import java.awt.Toolkit;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import javax.media.jai.JAI;
import javax.media.jai.RenderedOp;
public class clipboard
{  private File tempFile = null;
* @param args
static int BUFFER_SIZE = 65536;
public static void main(String[] args)
{  clipboard clip = new clipboard();
clip.writeImageFromClipboard();
public void writeImageFromClipboard()
{  Clipboard            clip = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable transferable = clip.getContents(null);
RenderedImage img = null;
FileOutputStream fileOutStr = null;
BufferedOutputStream bufOutStr = null;
DataFlavor [] dataFlavors;
File tempFile;
int
byteCount;
String [] strArr;
dataFlavors = transferable.getTransferDataFlavors();
System.out.println("clip=" + clip.getName());
System.out.println("Transferable=" + transferable);
for (int i = 0; i < dataFlavors.length; i++)
{  System.out.println("dataFlavours[" + i + "]=" + dataFlavors.toString());
if (transferable.isDataFlavorSupported(new DataFlavor("image/x-java-image; class=java.awt.Image", "Image")))
{ try
{ img = (RenderedImage) transferable.getTransferData(new DataFlavor("image/x-java-image; class=java.awt.Image", "Image"));
if (this.tempFile == null)
{ this.tempFile = File.createTempFile("__TMP_IMG__", ".jpg");
System.out.println(this.tempFile.getCanonicalPath());
fileOutStr = new FileOutputStream(this.tempFile);
bufOutStr = new BufferedOutputStream(fileOutStr);
// Encode the file as a JPG image.
JAI.create("encode", img, bufOutStr, "JPEG", null);
catch (UnsupportedFlavorException e)
{ e.printStackTrace();
catch (IOException e)
{ e.printStackTrace();
finally
{ if (bufOutStr != null)
{ try
{ bufOutStr.flush();
bufOutStr.close();
catch (IOException e)
if (fileOutStr != null)
{ try
{ fileOutStr.flush();
fileOutStr.close();
catch (IOException e)
else
{ System.out.println("Not an image!");

The login  you connected to the server  and run the above statement does not have permissions to operate  on this path "C:\Users\ISLLCdba\Desktop\MAA
PROFILE PICTURES\"
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • In an eMail message, when I attempt to save two photos by clicking the 'Save 2 Images' link, not the 'Save Image' link, the images are not saved. (I use I I apologize for the late notice, butOS7 on IPhone5). Is this feature broken?

    In an eMail message, when I attempt to save two photos by clicking the 'Save 2 Images' link, not the 'Save Image' link, the images are not saved. (I use I I apologize for the late notice, butOS7 on IPhone5). Is this feature broken?

    Please don't post the same question multiple times!

  • How do i disable the open/save image dialog box in firefox? I want to directly save the image file to the drive.

    How do i disable the open/save image dialog box in firefox? I want to directly save the image file to the drive without clicking on save option everytime when saving an image. I'm using firefox ver 35.0.1 for windows 7.

    Click on the Firefox menu. Then click "Options". Go to "Applications" tab. Search for jpg and png file type. You will find they have "Always ask" action attribute. Change it to "Save file".
    Hope it will work fine for you.

  • Need software which can send images to my editor, have them make selections, share them with me so I can edit the images and send the final results back to them.  Will Lightroom work?

    Need software which can send images to my editor, have them make selections, share them with me so I can edit the images and send the final results back to them.  Will Lightroom work?

    What I would like to do is to use Lightroom as I have been doing with LR 5.7.  Tag certain images to be shared to the Creative Cloud which my editor can then see and tag as to which she would like to see final versions of.  In the best case, I would then see these tags and edit the images as appropriate and save the JPEGs back to the Cloud where she can download them for final production.
    Possible?

  • I have forgotten my security question answers, i have tried to reset them but it keeps saying i need to save changes before i leave the page, i try to but it does nothing. help?

    i have forgotten my security question answers, i have tried to reset them but it keeps saying i need to save changes before i leave the page, i try to but it does nothing. help?

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
    Go to: Apple Express Lane;
    Under Product Categories choose iTunes;
    Then choose iTunes Store;
    Then choose Account Management;
    Press Continue;
    Now choose iTunes Store Security and answer the bullet questions, then click Continue;
    Sign in with your Apple ID and press Continue;
    Under Contact Options fill out the information and advise iTunes that you would like your security/challenge questions reset;
    Click Send.
    You should get a response within 24 hours by email.
    Presently there appears to be problems on Apple's end, so it may be quite some time before they respond.
    Another user had success doing the following:
    I got some help from an apple assistant on the phone. It is kind of round about way to get in.
    Here is what he said to do and it is working for me...
    on the device that is asking you for the security questions go to "settings", > "store" > tap the Apple ID and choose view"Apple ID" and sign in.
    Tap on payment information and add a credit/debit card of your preference then select "done", in the upper right corner
    sign out and back into iTunes on the device by going to "settings"> "store" > tap the Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you should be asked to verify your security code for the credit /debit card and NOT the security questions.
    At this time you can remove the card by going back in to edit the payment info and selecting "none" as the card type then saving the changes by selecting "done". You should now be able to use your iTunes store credit without answering the security questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • I did a presentation with many images and animations, now I need to change only the images without modify the related animations. How can I do it?

    I did a presentation with many images and animations, now I need to change only the images without modify the related animations. How can I do it?
    I use Keynote 09

    Select the image you want to change and go to Format Menu>Advanced>Define as Media Placeholder (or command, option, control i).

  • My Ipad crashed, so I pressed both power and home button, now I have to restart my ipad on the itunes, but there are some important info I cannot loose... how can I save this info at this time? actually is some info the I saved in the "notes" app! help!!!

    My Ipad crashed, so I pressed both power and home button, now I have to restart my ipad on the itunes, but there are some important info I cannot loose... how can I save this info at this time? actually is some info the I saved in the "notes" app! help!!!

    I Had it on my iPod, but I reset to factory settings and it got deleted :( If I find a way to get it back, I'll post it here so you can too.

  • I am using CS6 and when I go to save an image for Web the image does not retain its quality

    I am using CS6 and when I go to save an image for Web the image does not retain its quality. The first week I did this it worked just fine and now the images save very pixely.
    Here is a screenshot of my image on the artboard as I am editing it
    Here is a screenshot of the image as I'm trying to save it for Web
    As you can see, the image becomes pixely. I have tried to save it as every type of png and jpeg but nothing seems to work. I have no idea why it has started to do this. Please help!

    Change None to Art optimized then click apply(alteast in CS5 there was an apply, believe they removed that in CS6 as so many people missed that part).

  • I have thousands of pdf and need to change an image that is the same at all.

    Hi,
    I have thousands of pdf and need to change one image that is the same at all.
    Is it possible to do this automatically?
    Thanks.

    The image is the same size, but not in the same position
    Thanks

  • How can i save some image- profiles in the memory (RAM) of a system?

    How can i save some  image- profiles in the memory (RAM) of a system?
    (and then I want to read out the memory and save the profiles in a HDD, but first it has to write in a memory, because the write-speed is better by the memory )

    There must be an underlying premise for this question that I'm missing... When you run code everything is in memory... Programming 101. Create a variable, set a value to it, and it's in memory. Create a front panel control set a value to it and it's in memory. Data carried by the wires you use to connect your code is in memory. Or are you asking about controlling how that memory is managed - physical vs swap file?

  • How to make the results saved by the save button readable?

    The file is created but the results in the file is not readable... how do i solve this??
    I have 10 JTables in the page which i want to save all the stuffs in the JTable to the file selected by the user, the file is created but when the user opens the file, it is not readable.
    I used vector and i added the JTable into the vector and the results have squares and unreadable symbols....and i use file.log....or file.txt or file.doc the results of the file saved are the same....
    How do i solve this??
    Thanks....

    Hi DMMbeginner,
    the time scale is given by "X0" and "Delta_X". You can easily calc your own time scale from these values (x[i]=x0+i*Delta_X)...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Photoshop CC: Have a template that I moved image into.  Image is too small.  How do I resize the image while in the template?  Or must I go to original image file and resize there again and again until I get the right fit?

    I have a template that I am able to plug different pictures into at different times.  The problem is that when I plug an image into that template, I find that the image is either too big or too small.  Is there a way to plug the image into the template and resize the image (and not the template itself) OR will I have to go to the file with the original image and resize it there and then try to plug it in to the template to see if it fits------and if it does not fit, go back to the original file with the image and resize it again and see if that fits---and so on and so on...........?  I have tried the" image size" option but it's hit or miss------mostly miss!
    Thanks!

    Read up on Smart Objects. It looks like you have no idea as to how to create and use them.
    Jut create a Smart Object from the layer containing whatever it image it is that you are "plugging into your template".  But you do need to learn the application at its most basic levels.
    Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.  You cannot learn Photoshop in a forum, one question at a time.
    Or is it possible that you don't even have Photoshop proper but the stripped-down Photoshop Elements?"
    If the latter is the case, you're in the wrong forum.  This is not the Elements forum.
    Here's the link to the forum you would want if you're working in Elements.:
    https://forums.adobe.com/community/photoshop_elements/content
    If you do have Photoshop proper, please provide the exact version number of that application and of your OS.
    (edited for clarification)

  • How can we get the image which is stored in clipboard by labview, is there any functions available like text from clip board

    How can we get the image which is stored in clipboard by labview, i can get the text in clipboard by using invoke node directly.but i cannot get the image, is there any functions or vi available.(image is in Png format)

    The Read from Clipboard method is, unfortunately, limited to text. If the clipboard contains an image then you need to use OS-specific functions calls. This is an example program for Windows. It's old, but it should still work.

  • How do I change the image selected for the finalized movies pane in all events?

    How do I change the image selected for the finalized movies pane in all events? I made a movie some time ago in iMovie, and a still from this now appears as the image for Finalized Movies in the All Events pane (as well as showing up if I then click on this pane to take me to Finalized Movies). Anyone know how to change or delete this image, please?

    Unfortunately, the suggested solution in that thread does not work and the thread appears to be closed to replies.  That is, even though I am logged in the Reply|Quote|Mark as answer|Report as abuse items are missing.
    The suggested solution is:
    First, I found I had "img100.png" in  C:\Windows\Web\Screen  and
    C:\Windows\WinSxS\x86_microsoft-windows-themeui-client_31bf3856ad364e35_6.2.9200.16384_none_69ee3fa2269e545e
    1. Belonging to the Administrators Group, I replaced file Owner TrustedInstaller with my Username on both "img100.png" files
    2. After resizing the image I wanted to see on the Login screen to the resolution of "img100.png" file,
    I copied and pasted it to both "img100.png" files keeping this way the format (extension) and resolution of the original "img100.png" file,
    which I permanently deleted.
    However, I have not been able to replace the img100.pgn in C:\Windows\Web\Screen even after taking ownership of it and setting the permissions for my userid to All.  I edit it with mspaint and then try to save it. The save starts that then says the
    save was interrupted.
    The appears to be some additional protection besides the standard acls.
    http://www.saberman.com

  • Photos in album are only a hash-marked outline the image only shows when scrolling how can I see the image and open the photo?

    Photos in iPhoto album are only a hash-marked outline the image only shows when scrolling how can I see the image and open the photo?

    Make a temporary, backup copy (if you don't already have a backup copy) of the library and apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Select the options identified in the screenshot. 
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

Maybe you are looking for

  • Help for a newbie using the SAP tutorial

    Hi All, This is the first time i have picked up the SAP SDK and I am following the tutorial that is in the the help document that is installed with the SDK installation.  Under the developers guide section > Tutorial: Blanket Agreement Solution I hav

  • Excel OLE problems

    Can anyone provide information on how to call the different methods on an Excel. object. We used OLEgen to create the PEX file for Excel. However, when I try to invoke the Opentext method on the Excel.Application.Workbooks class, I keep getting an 'O

  • Exporting photos with keywords

    I recently organized over 600 family photos and organized each by keywords. I now want to export them to a CD to share. I am exporting the photos for my PC using family around the country. When I export the photos, the keywords don't go with it. Is t

  • Wvdial upgrade took my lib file and won't work

    Upgrade of wvdial took my /lib/libwvutils.so.4.0 shared object file. Was lucky I had pppconfig installed. Any place I can get this file? Thanks, folks. I installed wvstreams and didn't even have to symlink to get it to work! Again, thanks for the goo

  • Solman Configuration for Portal.

    Dears, We have installed solman 7.0 and configured it for all our ABAP stack servers. But now we want to configure it for our EP 6.0 also. Please suggest how can it be done. Is it possible to create RFCs in EP. Shivam