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

Similar Messages

  • 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

  • Copy paste clipboard Microsoft 2007 - It retains images I copy before and will not copy a new image

    I have Windows XP and Microsoft office 2007.  I had to choose 2010 forum because there was no 2007...sorry 
    I am trying to copy images from the Internet and I am able to copy the image but it will paste the first image I copy. It is not happening with the text though, only images. I highlight and copy a different image and it will paste again the first opne I
    copied. I have also done it through keyboard shortcuts and it will not do what it needs to do.
    I have copy pasted same images in the body of my aol emails and they copy ok. They also copy ok on the clipboard shortcut I made for clipboard , but it refuses to copy them on a new file in Microsoft word document. This started happening about a week ago.
    I have not installed a new program so I don't know the reason.
    I have defragmented, scan disk. I did scan disk simple and the one that recovers bad sectors. Rebooted computer, cleaned history, cleaned temp files. I am not very computer inclined, but I do know how to do these last I listed and I also have run Norton
    If anyone replies to this message keep in mind I can follow instructions, but if they are too intricate I might mess up :(  I wanted to know if there is a way of resetting Microsoft (I dont have the CD anymore) without uninstalling it. Any help yoou
    can throw my way will be appreciated. If there is anything else you need to know please let me know. I will be checking often.
    Thank you in advance.
    Ivee

    Hi,
    It's ok you don't have the CD, just go to the Start Menu > All Programs > Microsoft Office > Microsoft Office Tools, and then click on
    Microsoft Office Diagnostics. Run Diagnostics to proceed with diagnosis and repair.
    Check if it helps after running the Diagnostics.
    Regards,
    Melon Chen
    TechNet Community Support

  • Copying a slide to the clipboard?

    I want to copy a Captivate slide to the clipboard so I can
    edit it in a graphics program. The documentation first says:
    Adobe Captivate provides an easy way to copy a slide to the
    clipboard. Then the instructions say:
    To copy a slide to the clipboard:
    1. Open an Adobe Captivate project in Edit view.
    2. Select an image on the slide that you want to copy as a
    bitmap.
    3. Select Edit > Copy to Clipboard as Bitmap.
    4. .....
    How do I copy the entire slide to the clipboard as a bitmap
    in order to edit it, and not just an image on the slide?
    Thanks.

    Hi there
    Yep, you sure can! Insert a Highlight Box object. Configure 0
    for the frame width and 0% transparency. Here's where it gets cool.
    Click the color chooser, then the eyedropper and lift the color
    from the field. (Sometimes these are an odd color, so this helps)
    Now size and position the Highlight Box to cover the
    information you wish to hide. Once that is done, copy this to the
    clipboard. Here's where it gets even cooler! Choose all the
    remaining slides where you want to hide the info and paste. Whoosh!
    The Highlight Box is pasted in the EXACT location on each slide.
    (no futzing with placement!)
    Now all you have to do is visit each slide, right-click the
    Highlight Box and choose Merge into Background.
    This should accomplish what you are doing with editing in a
    different application.
    Cheers... Rick

  • 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 to save image from Clipboard to disk?

    Hello;
    I want to take a screen capture of the entire screen, not only the front
    panel and save it to a file. Don't care about the image format right now.
    I am able to simulate a PrintScreen key using a call to user32.dll
    "keybd_event" in Win2K, but I am stuck here. How do I get that image that is
    now in the clipboard to disk? I have searched NI's website high and low, and
    nothing yet.
    Thanks is advance,
    /JB
    LabVIEW 6.1

    I've kind of done it "programmatically".... using the "system exec.vi" I've
    started mspaint.exe... then, I paste the image and save it to disk (too bad
    the last two steps are manually done!!!)
    The limited documentation on System Exec says it has a Standard Input
    terminal... but, I haven't figured out how to programmatically send CTRL-V
    or ALT-E to the MSPAINT application as command inputs...
    Any further ideas?
    Bill
    Jimmy Brain wrote in message
    news:[email protected]..
    > Thanks Labviewguru, but those examples deal with copying text to/from
    > clipboard.
    > There was an example from a shareware program, but it does not allow
    > to save the image. The links to register it at the his website
    are
    > dead also.
    >
    > Nobody here has ever had the need to copy programmaticaly an image in
    > the clipboard and save it to disk?
    >
    > I know that IMAQ Vision can do it, but I do not have that.
    >
    > PS: I found this OCX ( http://www.simtel.net/pub/pd/57740.html ) on
    > the web that does this, but I haven't been able to get it to work from
    > inside LabVIEW. The Visual Basic example works, but I can't seem to
    > replicate the call to this OCX in LabVIEW.
    > I am mostly trying to learn on my own, that is why I want to much to
    > solve this.
    >
    > Thanks in advance for any help out there. I have become frustrated
    > with this little problem. I know someone might have an easy answer,
    > but I haven't found it yet. Thanks!!!! :-)
    > /JB
    > LabVIEW 6.1

  • Copy to new image

    Using Photoshop Elements 4.0 on Mac with Leopard, I find no convenient way to copy a selection directly into a completely new document. I must first create a new document and then paste the selection in the new document. I used to have the more direct option on the Windows program Paintshop Pro.
    Am I missing something?

    Does the Mac version not have the option File>New Image from Clipboard? That will do what you want.
    Make a selection. Edit>Copy. File>New Image from Clipboard.

  • 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:

  • Copying a disc image

    I created a disc image from iDVD to burn a movie. All that worked fine. I put the disc image on my desktop. I am now through and would like to copy the image to an external drive for archive. I keep getting "error code 0." I have tried several different methods to accomplish this with the same results.. Please help. thanks.

    The size of the disc image is the source of your problem. A drive that is formatted as FAT32 cannot contain a single file that is more than 4GB in size. You need to split the image into smaller pieces or reformat the drive in order to copy the disc image to it.
    ~Lyssa

  • Possible to copy recovery set image to HD for storage?

    I’m about to create a recovery set for my new Spectre ultrabook on a flash drive.  I’d like to then copy the recovery image to a drive on another PC so I can free up the flash drive for other use.  Is this doable?  I.e., if I need to restore, will I be able to copy the image back to the flash drive and have it work?  Are any special tricks involved?

    Hi,
    Not that simple, copy won't work. By the way, the Flash drive for Recovery is write protected.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Error message when I try to copy new files (images, documents) to mac from flash drive/SD card

    I am recieving an error message when I try to copy new files (images, documents) to mac from flash drive/SD card. The message is saying "operation cannot be completed because an item already exists with that name." They are brand new therefore not the same name? I cannot even put them in a brand new folder...  How can I fix this?
    Please help me!

    You don't need to recover the system.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ If you’re running Mac OS X 10.7 or later, open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy — do not type — the following line into the Terminal window, then press the space bar:
    dot_clean -m
    Switch to the Finder and drag the icon of the flash drive into the Terminal window. Some text will appear after what you entered. Press return.
    The command may take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear. Then quit Terminal and try the copy again.

  • After recording text using the dragon dictation app, it is converted, it can be copied to the iOS system clipboard for use in any app, how does the user access the clipboard to retrive this information if it is no longer on the screen?

    after recording text using the Dragon dictation app, it can be copied to the iOS systme clipboard for use in any app, how does the user access the clipboard to retrive this information if it is no longer on the screen?

    You need to do a long-press in any data entry field, then select Paste.

  • How to copy/paste texts/images from webpages in iBooks Author?

    Hi,
    I want to copy/paste text/image contents from webpages with iBooks Author, somehow images can't be copied, only texts can be copied with copy/paste editing. Wonder if there are any ways to include images with simple copy/paste?
    Tried to search iBooks Author help, could not find answers. Please help.
    Thanks

    Perhaps the people who spent a lot of time and money to produce the websites.....and who own copyright ...don't want anybody using their work without payment or credits. Have you contacted the websites owners to ask permission? 
    IF any person(s)  use anything from websites without permission apart from being to lazy to email to request permission....could face a legal action if and when the sites owners fins out. 
    There is another her misconception that "free" websites and content on "social media" such as the dreaded FaceBook....can be used without consequence. Almost all "free" websites are common licence material - which requires permission and those who give permission do so only for personal or none profit reproduction.
    i Use a blocking script on my websites which apart from preventing a right click...those who try are whisked off  my website to the the UK copyright website page which explains my rights! 
    You may wish to check out your iBooks contract with Apple and read their warnings on use of others copyright material. 
    You could ..and should contact the websites...explain what you want to use and why....and ask them if they can supply media.

  • 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

Maybe you are looking for

  • Firefox constantly crashes on startup

    Firefox is continually crashing on me. It opens for a few seconds to tell me it can't open my tabs, and then crashes. My Mac OSX is up-to-date, and I ran a virus scan yesterday (before I started having problems with Firefox) and it found nothing. I'v

  • HT4236 how to delete photos from photo libarby

    how to delete photos from photo album

  • Little bit of help

    Hi, I wonder if anyone can help me with my problem. Here is my piece of SQL. I know what I currently have - *(CASE WHEN ITL.FROM_LOC_ID = 'W%' THEN 'D1' OR WHEN ITL.FROM_LOC_ID != 'W%' THEN 'D2' END) Site* is wrong. And I was just wondering if anyone

  • Why does my home button keep sticking. I have to press it 4 or 5 times for it to take me from an app back to the home page

    My home button keeps sticking. I have to press it about 4 or 5 times to move from an app back to home page. Very frustrating when I want to change apps in a hurry. I have had the phone for just over a year without any problems. This started about thr

  • Installing from app store????

    Ok my first attempt at using ANYTHING from the app store failed. I downloaded (and it appeared to install properly), one of the freebies, "WeatherBug", and although it appeared to install (I had the icon on the home screen and when I went back to the