How to copy picture from a file to clipboard

11

6

How do I copy a picture from a file to the clipboard?

I can just select the file and press ctrl-c. But that wouldn't copy it to clipboard. It'll just be marking it if I want to copy the file somewhere else.

I can open the file in Paint and then change the selection to cover all the picture. I need something simpler.

user4951

Posted 2011-12-29T09:40:20.993

Reputation: 3 015

What's the reason for wanting to do this? - for context sake – Coops – 2011-12-29T14:39:55.570

Answers

1

If you're using Windows 10, the Photos app supports Ctrl+cing the opened photo.

Lucas

Posted 2011-12-29T09:40:20.993

Reputation: 134

15

Download nircmd and extract it or install it to "C:\nircmd" or a similar location. Within the folder will be 'nircmdc.exe.'

This can be used to copy an image to the clipboard. But, this still isn't quite as easy as you were hoping, so let's make it easier:

Open your registry editor.

Now, if you are unfamiliar with regedit, you may wish to find more help, but I will try to make this as simple as possible. First expand "HKEY_CLASSES_ROOT," then "*," then "Shell." Right-click on "Shell" and select "New->Key." Name this key whatever you want for example, "Copy Image to Clipboard." Now, right-click on this newly created key and once again select "New->Key." This one you will name, "command." On the right side, you will now see a value labeled "(default)". Double-click this item and under "Value Data:" put,

C:\nircmd\nircmdc.exe clipboard copyimage "%1"

Quoting the %1 parameter allows this to work with filenames that contain spaces.

Please note if you did not install it the same way as I did this may not be the exact location and you would need to replace "C:\nircmd\nircmdc.exe" with the proper address to that executable file.

Once complete, you will be able to right-click a file and select "Copy Image to Clipboard." From this point forward doing what you need will be just that simple.

Serodis

Posted 2011-12-29T09:40:20.993

Reputation: 442

This does not preserve png transparency. Any solution that does? – Mark – 2015-11-21T22:20:42.320

Thanks, this helped me a lot. Works like a charm! One small correction though. When you wrote This one you will name, "command." I think you meant to write This one you will name, "command". – macdonaldtomw – 2017-08-01T18:27:44.460

And it works :) – user4951 – 2012-01-01T13:08:42.550

1@Serodis Why don't you just upload the registry exported file which contains patch to the setting need to make (so as to have the context menu available)? – Nam G VU – 2012-05-03T08:03:01.483

@Serodis I do the same thing, but I cannot get it works for me on Windows 7 64bit 's Windows Explorer. But I can call it from command line by C:\nircmd\nircmdc.exe clipboard copyimage {path to my image}. Would you have any idea for me? – Nam G VU – 2012-05-03T08:35:56.077

2

You can use Nircmd.

nircmd clipboard copyimage sourcefile

surfasb

Posted 2011-12-29T09:40:20.993

Reputation: 21 453

1

Nircmd seems to be the way to go, but for those of us that can't freely install software (even freeware!) on their workstation computers, use Microsoft Paint:

From Windows Explorer, right click the file. The context menu option "Edit" will open the image in the Paint application by default (installed applications such as Adobe Photoshop will be used instead).

You can also open the image in Paint by using the "Open With..." option.

Once open in Microsoft Paint, select all and copy (Ctrl+A, Ctrl+C).


This does not involve taking an extraneous screenshot of the image (so long as it's not a proprietary format that Microsoft Paint can't open, in which case you'd probably want to copy the pixels in the proprietary application that opens such files).

This also strips any metadata that applications may inject to the image, so you get the plain pixel bitmap data in clipboard.

Similarly, use GreenShot to open the image file and click the "Copy to Clipboard" icon.

Elaskanator

Posted 2011-12-29T09:40:20.993

Reputation: 177

this is a very good answer as it requires no extra installation of tools or programs. – Adam.at.Epsilon – 2017-11-03T11:51:28.040

0

I found ClipSa on google, not tried it yet.

Not found anything to do the opposite yet though

mavhc

Posted 2011-12-29T09:40:20.993

Reputation: 156

1ClipSa is reverted way of the OP(original post), ie. from clipboard to file. What needed is to copy the image in the file to clipboard. – Nam G VU – 2012-05-03T08:04:52.247

-2

  1. Press "print screen"
  2. Now open Paint. ( It is under accessories ).
  3. Press Ctrl + V

Alternatively you can try an Open source software called "Green shot" ( http://getgreenshot.org/ ), it has additional feature - capture region of the screen. If that is what you are looking for. Another advantage of this free utility - It has a editor which is built in.

Wishwas

Posted 2011-12-29T09:40:20.993

Reputation: 128

This will still require you to open the file and create a screen shot, which means that the original resolution of the file will be lost (e.g. open a picture at a size larger than your actual desktop resolution). – slhck – 2011-12-29T10:05:38.893

No no no. Not from screen to clipboard. From file to clipboard. – user4951 – 2011-12-29T10:05:55.820

@JimThio It is a cool question, but isnt that what the grafics programs are for :-) It is almost as if you (and others) have hundreds of great ways to really "change" the OS itself. Why arent you the ones working at Microsoft? A clipboard manager with a context menu, that drops any "file" into the clipboard, Genious! – Psycogeek – 2011-12-29T10:43:08.343