File Exchange

image thumbnail

IMCLIPBOARD

version 1.2.0.1 (3.79 KB) by

Copy and paste image data to and from system clipboard.

10 Downloads

Updated

View License

IMCLIPBOARD behaves very much like MATLAB's "CLIPBOARD" function, but it works on image data. You can paste image data from the clipboard to a MATLAB array, and copy MATLAB image data to the clipboard.
From HELP:
IMCLIPBOARD('copy', IMDATA) sets the clipboard content to the image represented by IMDATA. IMDATA must be MxN grayscale (double, uint8, uint16), MxN black and white (logical), MxNx3 true color (double, uint8, uint16)
IMCLIPBOARD('copy', X, MAP) sets the clipboard content to the image data represented by indexed image X with colormap MAP. X must be MxN matrix (double, uint8, uint16) and MAP must be Px3 (double).

IMDATA = IMCLIPBOARD('paste') returns the current image content in the clipboard as a true color image (MxNx3 uint8).

[X, MAP] = IMCLIPBOARD('paste') returns the current image content in the clipboard as an indexed color image.

IMCLIPBOARD('paste') displays the image in a new figure window.

[...] = IMCLIPBOARD('paste', FILENAME) saves the image as FILENAME. FILENAME must be a name to one of the following image formats: JPG, GIF, BMP, PNG, TIF.

Note: IMCLIPBOARD requires Java on all platforms.

Comments and Ratings (12)

AV

AV (view profile)

This is great in Windows, indeed. Does anyone have this working on OS X? I'm attempting to modify it for OS X... it appears to get the clipboard object but it's unhappy about getData. Help is appreciated! Thanks.

Ilya Belevich

Norman Koren

Alexander

Perfect tool for automatically moving images to the clipboard so that they can be copied into Word etc.

Daeyong Kim

It's great.

Will Reeves

owr

owr (view profile)

K E

K E (view profile)

Matlab's default Figure > Copy option is vastly improved witht he following,
imclipboard('copy', export_fig('r', 190, 'format', 'png'));
This is useful for copying a figure into Outlook or Word.
[credit for this solution to by Oliver Woodford not me! http://mathworks.com/matlabcentral/answers/21962-export-figure-to-microsoft-outlook]

Eric

Eric (view profile)

Whoops - the problem was with how I was calling it. It works great from within a GUI as well. I'm using it to copy an image of my GUI to the clipboard. This function gives a nicer image than print(gcbf, '-dmeta').

Eric

Eric (view profile)

Eric

Eric (view profile)

It does what it says. However, when I call it from within a GUI, the next callback that is activated (by changing a number in a text box or clicking a button), does not execute. As an example, I get the following warning for my GUI called ProductViewer. I can generate a similar error by activating any control in the GUI.

Warning: Error occurred while evaluating listener callback.
> In graphics\private\clo at 83
In cla at 29
In newplot>ObserveAxesNextPlot at 125
In newplot at 74
In imagesc at 21
In ProductViewer>PlotFrame at 629
In ProductViewer>edit_row_min_Callback at 514
In gui_mainfcn at 96
In ProductViewer at 87
In @(hObject,eventdata)ProductViewer('edit_row_min_Callback',hObject,eventdata,guidata(hObject))

Updates

1.2.0.1

Fixed java error that many have mentioned in the comments.

1.2.0.1

Updated license

1.2

License update

1.1

Updated copyright in Java code.

MATLAB Release
MATLAB 7.11 (R2010b)
Acknowledgements

Inspired by: clipboardimage, clipboardpaste

Inspired: export_fig, Microscopy Image Browser (MIB)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video