Copy Image to Clipboard - possible in jdk1.3?

The subject line says it all - is it possible to transfer images to the system clipboard using jdk1.3?
I know that jdk1.4 has DataFlavor.imageFlavor, but is there any way around this in jdk1.3?

I'm not that expert in Copy/Paste, but I suppose you could make an Image class which implements Transferable and try with flavor "localJVMMimeType" (or something like that, see the tutorial), and the class you want to use.
Greetings,
Silkje.

Similar Messages

  • Copy image from clipboard

    hi
    Is there any way to find out about type of image that you are coping from clipboard. Because i receive only this type image/x-java-image. I need to know if image is jpg or png.

    read the OP, OK then. "image/x-java-image", not application/x-java-file-list.
    the question was "what type of image was
    copied to the clipboard". if it was pixel/raw data
    then whether or not it was jpg or png is what's
    irrelavent. That is what I said in my first post. "image/x-java-image" is what Java return when you copy a Image (print screen, open Paint select, copy etc).
    When you copy a File it returns a List of Files.
    i felt it was obvious that this was a
    file (which is still an image) and not pixel buffer
    data.It sounds to me like the OP has copied an image from an image program (or hit print screen). At which point it is a raw pixel buffer.

  • Copying Image to clipboard

    I would like to copy graphics (e.g. plot or table) in the application to the SystemClipboard. The goal is to be able to transfer this image to the other application.
    It is rathewr simple to copy text, however it is not clear how to copy graphics.
    Anybody has experience?
    Code snippet would be helpful
    Thank you.
    Leo

    If you have access to JDK 1.4, you can use java.awt.Robot quite simply with the predefined imageFlavor. Before that, I don't know how to get the system to recognize the Image flavor really...anyone?
    Here is an example how with 1.4:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.datatransfer.*;
    public class MySystemClipboard extends Frame implements ActionListener,
    ClipboardOwner
        private Button myButton;
        private Clipboard myClipboard;
        private PrettyPicture myPicture;
        public MySystemClipboard()
            add(myButton = new Button("Klipp"), BorderLayout.SOUTH);
            add(myPicture = new PrettyPicture(), BorderLayout.CENTER);
            myButton.addActionListener(this);       
            myClipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        public void actionPerformed(ActionEvent anEvent)
            try
                ClipImage ci = new ClipImage(new Robot().createScreenCapture(getBounds()));              
                myClipboard.setContents(ci, this);
            catch (AWTException ae){}
        public void lostOwnership(Clipboard clipboard, Transferable contents) 
        private class ClipImage implements Transferable
            private DataFlavor[] myFlavors;               
            private BufferedImage myImage;
            public ClipImage(BufferedImage theImage)
                myFlavors = new DataFlavor[]{DataFlavor.imageFlavor};
                myImage = theImage;
            public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException
                if (flavor != DataFlavor.imageFlavor)
                    throw new UnsupportedFlavorException(flavor);
                return myImage;
            public  DataFlavor[] getTransferDataFlavors()
                return myFlavors;
            public boolean isDataFlavorSupported(DataFlavor flavor)
                return (flavor == DataFlavor.imageFlavor);
        private class PrettyPicture extends Panel
            public PrettyPicture()
                setBackground(Color.blue);
                add(new Button("Moo"), BorderLayout.NORTH);
                add(new Button("Boo"), BorderLayout.CENTER);
                add(new Button("Roo"), BorderLayout.SOUTH);
        public static void main(String[] args)
            MySystemClipboard cb = new MySystemClipboard();
            cb.setBounds(200,200,200,200);
            cb.setVisible(true);
    }This works for me with JDK1.4 in Windows NT, using Word to verify the clipboard contents (pasting in pictures). This does not work in previous versions, since DataFlavor.imageFlavor didn't exist then. I don't know of any equivalent substtitute.
    You can easily change the bounds of the picture to catch, as well as the actual contents of it
    HTH,
    Fredrik

  • Safari cant copy images

    I went to amazon.com and tried to copy some of the images for the Zire 72 and paste it into an email message, but everytime it copied the image address. I set it to copy the image, and not the image address, but when I pasted into the email body, I saw the address. And no I do not currently and never plan to use Apple mail.
    I had the same problem with FireFox(which cant copy images to the clipboard anyways). To fix the problem I had to use classic Internet explorer. What a hassle.
    John

    Hi John!
    I'm not sure which images you are trying to C & P from Amazon.com, but, using Safari, I was able to copy the image found HERE, and paste it into an AOL eMail document. It was then successfully sent, and when opened, the image appeared in the body of the mail.
    Maybe I'm not quite understanding what you're trying to do.
    Position the cursor on the image.
    Press the "Control" key and hold the mouse down.
    Select "Copy Image to Clipboard".
    Open a new AOL eMail document.
    Click in the message area of the document.
    Select "Paste" from the "Edit" menu, or "Command Key + V Key.
    Your will be presented with a resizing option. Click Yes or No.
    Address your eMail and send!
    Good Luck!
    ali b

  • I want to copy images to a memory stick for sharing with my family. This was possible in iPhoto via copy/paste but does NOT seem to be possible with photos...

    I want to copy images to a memory stick for sharing with my family. This was possible in iPhoto via copy/paste but does NOT seem to be possible with photos...

    You can drag and drop (this will result in a compressed JPG) or hold the alt key and drag and drop (this will copy the original). You can also select the pictures and choose Export from the File menu.

  • Copy a Dicom Image to Clipboard

    hello,
    Iam trying to copy a DICOM image to clipboard using java swing.
    But at the time of copy it shows the following Exception.
    com.sun.medialib.codec.png.PNGException:
    codecLib: image palette error. [PLTE]
    at com.sun.medialib.codec.png.Encoder.setPalette(Encoder.java:187)
    at com.sun.media.imageioimpl.plugins.png.CLibPNGMetadata.writeMetadata(CLibPNGMetadata.java:2616)
    at com.sun.media.imageioimpl.plugins.png.CLibPNGImageWriter.write(CLibPNGImageWriter.java:198)
    Iam using the code part to copy the image is:------
    public void setClipboard() {
    m_bufImage = m_origImage = m_currBean.getImage();
    if (m_bufImage != null) {
    ImageSelection imgSel = new ImageSelection(m_bufImage);
    try{
    Clipboard clipboard = Toolkit.getDefaultToolkit ().getSystemClipboard();
    clipboard.setContents(imgSel,null);
    }catch(Exception e){
    e.printStackTrace();
    If anybody is familier with this error please send me a solution to solve this problem.
    thanks in advance
    suryasri

    Hi,
    try to read this SUN article.
    http://developer.java.sun.com/developer/technicalArticles/releases/data/
    Hope this help you.
    Bye
    Ste

  • HT201302 iOS: Importing personal photos and videos from iOS devices to your computer, but I want to reverse the process and copy images from my desktop Windows PC to my new iPad Mini.  Is this possible in some more direct way than through copying several

    Instead of copying images (jpgs, etc) from my iPad Mini to my desktop PC, I'd like to do the opposite, that is, copy existing images from my PC files to my Mini without going through a multi-email process which involves resizing the images by experiment.
    I hope someday Adobe Lightroom can add this feature, but I'll settle for some simple transfer, perhaps by cable between my PC and my Mini.
    Jim Mohundro

    You can do it via your computer's iTunes. If you are on iTunes 11 on your computer then you may want to re-enable the left-hand sidebar via View > Show Sidebar (option-command-S on a Mac, control-S on a PC), which might make it easier to navigate and my instructions may make more sense.
    To sync photos, connect and select your iPad on the left-hand side of your computer's iTunes (if you've enabled the sidebar), and on the right-hand side there should be a series of tabs, one of which should be Photos - if you select that tab you can then select which photo folders to sync to the iPad. There is a bit more info on this page. You will need to sync all the photos that you want on the iPad together in one go as only the most recent photo sync remains on the iPad - synced photos can't be deleted directly on the iPad, instead they are deleted by not including them in the next photo sync.
    If you haven't enabled the sidebar, then from your library click 'iPad' at the top right of the screen and you should get a series of buttons along the top of the screen, including one for Photos

  • Copy Image command is broken.

    I have just completed an upgrade to Mac OSX 10.3.9, the security update and the accompanying update to Safari to 1.3.2.
    And my wife pointed this out to me... the Contol-Click "Copy Image" function is not broken, as it does not copy the image to the clipboard, but rather the URL of the image or the LINK is what gets pasted into other app.
    According to Safari Help, that is NOT the correct fucntionality.
    To save an image, drag it from the webpage to the desktop or a document in another application. You can also hold down the Control key and click the image, then choose Save Image To to save it as a file or Copy Image to paste it in another document.
    The cntl-Click options pop-up now read:
    "Save Image to the Desktop
    Save Image"
    This is definitely a Safari glitch, as Drag and Drop still works to move the image, not the URL or Link. I was also able to do a proper "Save As.. " with the ablility to select the destination, this in now gone as well.
    Bug, or new (crappy) "feature?"
    Anyone run into this, or have a fix to restore the functionality?
    Kurt Griffith
    Nanuet, NY
    G4 Quicksilver 733 1GB Ram   Mac OS X (10.3.9)  

    Ahhh... that is helpful. Gets me halfway there.
    Possibly the issue is that some coding changes in either Safari or OS X have the function work correctly in 10.4.x but are glitchy in 10.3.9... ?
    The same problem persists in Safari 1.3.2 (on our iBook) in 1.3.9
    Ahhh.. interesting (not all apps have "Paste Special"...) Works in MS Word X, but not Appleworks. Preview "New From Clipboard" works as advertised.
    Problem could just as easily be with Appleworks somewhat outdated code? 6.2.4 dates to 2002.
    Thank you Tom, for giving me some avenues to investigate.

  • How to copy images from another MC in reversed order??

    Hi everyone,
    I'm new to AS3 and have been fighting and searching for a solution to this problem for a week now, and I'm VERY close!
    I crated a MC holding of a series of images (about 50) and I jump around in it using plenty AS3 scripts (most of which I don't fully understand yet, but I'm working on that to! )
    I had to find a way to "rewind" (= play backwards) the MC. Since there is a stop(); command in almost every frame, prevFrame does not work and if I put that in a loop, it goes WAY to fast (but worked).. So I could think of only one way...
    Create a new (reverserd) MC with the same image sequence ald reverse it manually and play that one.
    This all works fine (very proud of it ).
    Now my question:
    To get this to work for multiple image sequences, I have to load all images twice (once in MC_1 and again in MC_2 and select them and reverse them).
    Not a big one, unless you want to create MANY of those SWF's...
    Is it possible to load the 50 images of the first MC in reverse into the second MC dynamically? JUST the images, noting else.
    extra info: the MC_2 is already in the lib(empty) and placed on the stage.
    something like:
    var pointer:Number=1;
    for (var:i:Number=50;i>=0;i--) {
    get MC_1.picure(var);
    put it in MC_2.frame(pointer);
    pointer = pointer + 1;
    All help is welcome and please take into account that I have little experience and copy most of my scripting from people like you
    T.I.A.
    Melluw

    I tried your advice (thanks for that)
    The event I already have is the mouse leave
    I //-d out the part I removed (what did work)
    The code I ended up with is:
    function Start() {
    stage.addEventListener(Event.MOUSE_LEAVE, cursorHide);
    function cursorHide(evt:Event):void {
    var currFrame = MC_1.currentFrame;
    if (CCW == true) {  //it is true in this case
      movStart = (50 - currFrame);
    else {
      movStart = currFrame;
    if (movStart>25) {
      MC_1.prevFrame();
    // removed swapChildren(MC_1, MC_2); // This is the part I removed
    // removed MC_2.gotoAndPlay(movStart);
    else {
      MC_1.gotoAndPlay (movStart);
    And if I leave the stage on the part where movStart is indeed >25
    Nothing happens,
    So I guess this is not what you meant
    Subject: Action Script 3 how to copy images from another MC in reversed order??
    I cannot direct you in the loading of the images approach, it will be too complicated, and will probably not work anyways... when you move away from a frame that has dynamic content, you lose the content.  So basically, there is nothing practical in taking that approach.
    I do niot understand what the problem will be with the enterFrame/prevFrame approach. If everything you can do with the mouse is already used (which I doubt) by the first mc, then there is nothing else you can do with this file.  You probably just need to rethink your control scheme.  You should search Google for "AS3 slideshow tutorial", and to lighten up your design, add "XML" in that search.
    >

  • Adobe Reader 9 Mac - cannot copy images

    I upgraded to Reader 9, and another person in our office is using 8 with the same problem. We can no longer copy images out of a PDF - when we try to paste an image that appeared to be copied we only get a gray box. We've tried many ways including pasting directly into Word or Excel, choosing 'New from Clipboard' in Photoshop Elements, creating a blank Photoshop file and pasting, etc. This has works perfectly in Acrobat 5.0 and in Reader 7.0.5 (which I have gone back to using - I'm sure glad I waited before removing it from my system!).
    Any thoughts?

    (Gary_Roger) wrote:
     I was wrong on both counts. With the help of the local Apple store, I found a solution. First, I Moved to Trash all adobe related files/folders from /Users/*myaccount*/Library/Cache and /Users/*myaccount*/Library/Preferences. When I started "Adobe Reader 9", I at least got the license agreement but again it failed with an "internal error". I then moved the /Users/*myaccount*/Library/Application Support/Adobe folder to my desktop. I was then able to start "Adobe Reader 9" successfully.
    I was having the "Internal Error" message on all my repeated installs of Reader in Mac OS 10.6 ("Snow Leopard") and this fixed it for me. The only thing I did different, was after the app finally launched without an error, I dragged all the non-Acrobat Reader folders inside of /Users/*myaccount*/Library/Application Support/Adobe back to the folder. I then re-launched Reader just to check and all was fine.
    Thanks! This fixed my Adobe Reader on Snow Leopard problem.

  • More DataFlavors copied to the clipboard/used in D&D in one step

    Hallo,
    For my GUI app. I would like to enable different types of information to copied to the clipboard.
    e.g. object type 1 - Document ID ( actual row's document ID from JTable ) - to copy document type
    object type 2 - string representation ( columns texts from JTable ) - to copy to excel
    I would like to keep them general, with different possible combinations
    among them ( up to 10 different object types ), according to some specs.
    Has anybody idea, if it is possible ? ( prefarably with 1.4 D&D interface ).
    Data are packed in createTransferable() call, but it allows just 1 format (?) ...
    Maybe I can use some 'envelope' format holding all possible information,
    but that idea doesn't looks nice for me :(
    Thanks for any hint.
    Tibor

    Hi !
    Thanks for your help. For drag & drop it's fine. System will ask for 'best' format as I expect.
    How is it with clipboard ? I had idea to copy table columns as a "text" flavor
    ( for paste into excel ) and user created flavor "id" with documentId inside.
    On paste I would take 'what's better' ( e.g. as a document reference better would be better my "id" flavor,
    because that information doesn't need to be in table cells inside ).
    Maybe I will have to use 'own' clipboard for these reasons.
    Tibor

  • Paste image from clipboard works in Chrome but not in Firefox

    Hi there,
    I would like to know a bit more about the technical reasons why image pasting from clipboard works on Chrome but not Firefox.
    Steps to reproduce:
    1. Open the text editor on github.com, e.g. by commenting on an issue
    2. Copy an image to clipboard
    3. Put the mouse cursor into the text editor area
    4. Use CTRL+V to paste the image into the text editor
    On Chrome, the image is pasted and automatically uploaded on Github. On Firefox nothing happens.
    Can someone please shed light on this lacking feature?
    I would so much love to see support for this on Firefox as it is a very convenient functionality.
    Thank you!

    The best is to try it yourself I guess.
    Go to Github and try pasting an image into the compose editor.
    The editor definitely supports image pastings. They work directly in Chrome(ium).
    Thus I am wondering why Firefox does not support direct pasting from clipboard into the editor.
    See the attached screenshot regarding the editor I am talking about.

  • How do i copy images from the web?

    How do I copy images on the web for use in a powerpoint presentation?

    Drag them to the desktop or control-click them and choose to copy them to the clipboard.
    (61484)

  • Append copyright text to copied text in clipboard

    Is it possible in RH6 to append a copyright string to the
    text that a user has just copied to the clipboard, so that when
    they paste it, they get the text they copied, plus the copyright
    string? The old WinHelp application that I am converting to HTML
    help had this feature - I believe the old project was authored in
    RoboHelp, but have no idea on how they included the copyright
    string. I haven't found anything in the help that references
    functionality like this, nor have I found anything online.

    Hi,
    Make use of READ_TEXT and SAVE_TEXT FM to get the additional text and add to the existing text.
    Regards,
    Ankur Parab

  • I'd like to save to file/database image from clipboard

    Hi, I've got following problem.
    In my swing application I would like to pase image from clipboard (f.ex. copied from msword). I use following code to do that:
    TransferHandler handler=jLabel.getTransferHandler();
    handler.importData(jLabel,clipData);
    Then I want to save image to database.
    I know it should look like this:
    ImageIO.write(RenderedImage im, String formatName, OutputStream output);
    But how to transform image from clipboard or graphics from jLabel1.getGraphics into RenderedImage ???
    thanx in advance !

    Starting with the original image I adjusted the levels (Image>Adjustments>Levels (Ctrl L) to the following settings:
    Then using the marquee tool I selected the areas not in use and filled with white:
    Till you get something like this:
    Then I used the brush tool to fill the other bits of the lines in white using these settings:
    Once you are happy with the result with a white background go to the Blending Options on your layer:
    and set the blend as below and press ok:
    This will make your layer look like its got a transparent background, then create a new transparent layer and place underneath:
    When you have done this combine the 2 layer by selecting both and then right click and merge layers:
    After these steps save as a .psd file then you can copy anything you need from this file.
    I hope this all makes sense and you get the result you want. Like I said fiddly! :-)
    End result:

Maybe you are looking for

  • Adobe Photoshop Elements 10 Activation (Deactivation impossible)

    Hello, I want to activate my Adobe Photoshop Elements 10 on my new computer. However, I cannot deactivate it on my old computer first, since that computer is broken (I know I can activate it on two computers, but that second activation is already tak

  • Pending Service PO report

    Dear All, please tell me report for Pending Service PO report. Because in me2m,me2l,me2n To be del qty is zero though thers is pending qty in PO. Thanks in advance. Regadrs, Gietsh

  • Passing parameter to a LOv

    hi all, i have a select statement like select v_code,v_location,v_name          from v_master         where trunc(v_date) between :block.item1 and :block.item2         and v_job = :block.job         and v_status <> 'C'the v_job i should pass it as a

  • Persisting Configuration in Config.xml, Using Administration MBeans

    Dear Friends, I am facing a problem on persisting the configuration, using the administration Mbeans. I am using weblogic 6.1 sp1 version. And i am running weblogic in production mode. i have made the AutoDeployEnabled=false in my config.xml file. In

  • Subinventory Transfer documents to be flown.

    Can a approval cycle exist in the Subinventory Transfer. Do we have the documents that can support the subinventory transfer. Regards Sri