Copy and Paste image to clipboard-- color & size adjustments

Hello,
I wrote a small program (JDK 1.4.1) which enables the user to copy an image (gif or png) to the clipboard.
- when this image is pasted into Microsoft Words, the size is not respected (much bigger),
- when it is pasted into Lotus Notes, the colors are all sort of green (but the size is correct this time)..
- when it is pasted into Excell: no problems! Copying it back in the clipboard from Excell, and pasting it into Words and Lotus Notes gives good results.
I do not know where the problem comes from (Windows or Java?), but I would be very glad if someone could point me out some ways of debugging this.
Thanks very much in advance for any help!
Best regards,
Yannick
Relevant pieces of code:
if (source.getText().equals("Copy to clipboard")) {
try {
cs = (ClipboardService)ServiceManager.lookup
("javax.jnlp.ClipboardService");
} catch (UnavailableServiceException use) {
cs = null;
if (cs != null) {
ImageSelection contents = new ImageSelection(image);
cs.setContents(contents);
public class ImageSelection implements Transferable, ClipboardOwner {
static public DataFlavor imageFlavor;
private DataFlavor [] supportedFlavors = {imageFlavor};
private Image picture;
public ImageSelection (Image parPicture) {
picture = parPicture;
imageFlavor = DataFlavor.imageFlavor;
public synchronized DataFlavor [] getTransferDataFlavors () {
return (supportedFlavors);
public boolean isDataFlavorSupported (DataFlavor parFlavor) {
return (parFlavor.equals (imageFlavor));
public synchronized Object getTransferData (DataFlavor parFlavor)
throws UnsupportedFlavorException {
if (parFlavor.equals (imageFlavor))
return (picture);
else
throw new UnsupportedFlavorException (imageFlavor);
public void lostOwnership (Clipboard parClipboard, Transferable parTransferable) {
System.out.println ("Lost ownership");

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

Similar Messages

  • Copy and paste images on iPad air 2

    Can i copy and paste images from safari onto documents that i access through my iPad air? I use this device in university and i found that when i tried to copy an image into a docs app document, the only thing i could paste was the image url. Does anyone know how to copy the image and not the image url?

    Hold your finger on the image and select save image instead of copy. Then add the image from photos. The photo below was saved from eBay. If that doesn't work you have to tap the image and move the brackets until the image is blue then tap copy.

  • I used to be able to copy and paste images from the internet into keynote slides and pages. Now when I copy and paste all I get is an empty  box. My iskysoft iTube studio has also stopped downloading videos. Is there an extension I need to enable?

    I used to be able to copy and paste images from the internet into keynote slides and pages. Now when I copy and paste all I get is an empty  box. My iskysoft iTube studio has also stopped downloading videos. Is there an extension I need to enable? Any ideas

    Try dragging the image to the desktop, then drag the image to the slide you want it on

  • Unable to copy and paste images in latest "Pages"

    I use to be able to copy and paste images in my old pages by ctrl + click and choose "copy" and then reverse the process by ctrl + click and choose to paste it.
    But now since I updated to the latest pages I am unable to execute this function.
    My computer has OS X 10.9.1 and Pages 5.0.1.
    Is there any way I could get this working by the above mentioned method.
    Regards

    It is not ctrl. Unless you are talking about right clicking and using the contextual menu.
    It is command c (copy) command v (paste).
    There are a number missing features in the contextual menu in Page 5.
    Apple has removed over 90 features from Pages 5.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5 and rate/review it in the App Store, then get back to work.
    Peter
    Peter

  • Copy and paste image from IE to Illustrator

    Dear Illustrator users,
    I need to copy and paste images from IE10 or IE11 (Internet Explorer) to Illustrator (CS6, CC).
    I right-click image, choose "copy" in Internet Explorer
    now I can paste it to mspaint, word, photoshop, etc. It works fine..
    but when I try to paste image to Illustrator, it pastes url link instead of image.
    I know this problem comes with IE10. When I downgrade to IE9, it start to work fine.
    Any suggestion?
    Kind Regards,
    Jarda

    Hi Jacob,
    Thank you for a quick answer. Your suggestion is correct, but saving image to a file is an additional step.
    Since I do this task "thousands a day", this is unacceptable
    Any other suggestion?
    Regards,
    Jarda

  • Can't copy and paste images that i've converted from pdf to word

    can't copy and paste images that i've converted from pdf to word

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • I cant copy and paste images with firefox but i can with MS explorer why and how is this?

    i cant copy and paste images with firefox but i can with MS explorer why and how is this? i can only copy text but not images is ther a way i can copy images with firefox and how??

    I was having this issue with MS Live email. The old Microsoft shortcuts work. For copy press ctrl+c. For paste press ctrl+v. Here is a webpage that lists all Firefox shortcuts. http://www.mouserunner.com/FF_Shortcuts1Printable.html

  • How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?

    How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?

    Or choose Window > Arrange > Tile
    And, you of course can copy/paste without tiling.

  • I can't copy and paste images, both in Windows and Linux mozilla

    I can't copy and paste images when using Mozilla for Linux and Windows

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • I am having troubles with 3 things: scrolling with my laptop mouse, controlling my laptops volume with F9 and F10 keys, and I can not copy and paste images.

    I am having troubles with 3 things: scrolling with my laptop mouse, controlling my laptops volume with F9 and F10 keys, and I can not copy and paste images.

    Hello,
    Try disabling graphics hardware acceleration. Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    *Click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    volume controls issues are windows, not firefox.
    How your copy and paste your image? from where to where

  • How do I copy and paste images without a reduction in size?

    I am working on a project where I want to include several jpeg images that are saved on my computer onto a new single 8.5x11 page in Photoshop. Even though the percentages are the same on both the images and the Photoshop page, when I copy and paste the images onto the page, the size of the images are greatly reduced (from 5" to 1".)  I would greatly appreciate instruction on how to copy images and paste them on to a Photoshop page without the reduction in image size. I have accomplished this task previously and I had no problem. Is there a setting that I am unaware of that I need to change in order to proceed with the project as planned? Thank you for your time.

    You are a genius! That's it. Thank you so much for taking the time to help...

  • Cannot copy and paste images from the web into Corel Draw

    Attempting to copy and paste a jpg image from a client's website, for use in Corel Draw... Copy appears to work fine, and pasting into other programs like Windows Paint works, but paste to CorelDraw has no result.
    I've seen where others would get the text URL but nothing happens when I hit paste.
    Drag and drop imports the text name of the image.

    Since Firefox 13, when you copy an image, Firefox places both the image data (bitmap data) and the URL of the image on the clipboard. I can see why you would get one or the other, but I can't think of why you would get nothing.
    Did this just start in Firefox 22?
    Some odd interactions have been noted between Firefox 22 and ZoneAlarm: when ''copying'' selected text in Firefox, the clipboard may end up blank a significant percentage of the time . But it sounds as though you have a different issue.
    Do you have the same issue in Firefox's Safe Mode? That's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

  • Copy and paste image from PDF to another application

    how do you copy and paste an image from PDF into another application such as Word or Excel? I know how to copy>> hover cursor over picture until it turns into a select "+" tool, select and right click to copy but when I try to paste it into another application, its loses all of its formatting. Thanks

    Not sure what you mean by formatting of a picture. You can export all images and get a files to import to word. You can also use the snapshot tool, though it captures a screen copy. If you select an image and copy, my experience has been that it will only copy to PhotoShop, but it is not something I do very much. If the image is part of the document (not markup like a stamp or such), you can use the select tool to select the image and copy it to the clipboard. Just tried it and it worked fine. If it is a stamp (like pasted in), then you can not copy it in this way, if at all.

  • Copy and pasting image onto a layer's channel

    Hi,
    I would like to know how to copy and paste an image onto a particular layer's blue channel.  (prefer non-action listener scripts) 

    I think the applyImage command is the best way to copy an image into a channel. But that needs scriptlistner. So here is how to do it with the clipboard without scriptlistner.
    var currentChannels = app.activeDocument.activeChannels;// store the activeChannels to restore later
    app.activeDocument.activeLayer.copy();// copy the image
    app.activeDocument.activeChannels = [ app.activeDocument.channels.getByName( localize( '$$$/ColorModes/RGB/ChannelName/Blue=Blue' ) ) ];// make the blue channel active
    app.activeDocument.paste();// paste the image into the channel
    app.activeDocument.activeChannels = currentChannels;// restore the channels

  • Copy and Paste images to Word using Adobe Flex3

    I am trying to copy the images from Adobe Flex 3 application
    and paste it in the Microsoft Word or PowerPoint. I couldn't find
    any examples online. I am not sure whether I could do this using
    Adobe Flex3. I know this is possible with Adobe AIR.
    Could you please provide me an example for how to do this
    using Adobe Flex3?
    Thanks,
    maluri

    Good question.  Make a local copy first, i.e. drag to your Desktop,  then drag to Word.
    If that does not work, open the image>command-A>copy  and paste into word.

Maybe you are looking for

  • I am having a game issue, and I am trying to diagnose it...

    I am having a problem with the demo for Empires: Dawn of the Modern world. The game hasn't been released yet, but the demo is available, and I am having a severe problem with it, but I'm not sure what is causing it.   My problem is that the game cras

  • Error while running import command

    Hi all,when i am trying to run import from putty i am getting error import: unable to open X server `'..Can any one suggest me how to overcome this error? import D:/OAF/jdevhome/jdev/myclasses/xxc/oracle/apps/po/student/webui/XXCStudentPG.xml -userna

  • Company Code reset

    Hi All, I have an issue while resetting the transaction data for a company code using t-code OBR1. After resetting, in FBN1 when i check for any docs existing , its showing up no docs but when i check in the PO history accounting document line items

  • Socket 8_MS6103 Board

    I have a Socket 8 board (MS6103) which functions perfectly but is slow by today's standards.  It is equipped with one processor but has scope for a second.  I'm interested to know whether it's worth adding a second processor (assuming I can find one)

  • Wha' Happen? I Can't Do My Wurk!!!

    Sorry for the Mighty Wind reference..<G> But I was arranging some files in the HD window, you know where the side bar lists; Desktop,Users,Applications, Documents, Pictures and used to list MUSIC! I say used to as I accidently slid it out the window