18

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.

slhck
  • 235,242
user4951
  • 5,029
  • 27
  • 76
  • 111

7 Answers7

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.

Kevin
  • 103
Serodis
  • 442
5

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

Lucas
  • 182
3

In addition to the nircmd solution I tried the same approach with PowerShell to avoid 3rd party software with answers from this question.

It is slower and also a PowerShell window is visible. The "hidden" option makes it acceptable.

The "Extended" makes it available in the extended context menu (Shift+Right Click).

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT*\shell\Copy Image to Clipboard] "Extended"=""

[HKEY_CLASSES_ROOT*\shell\Copy Image to Clipboard\command] @="powershell.exe -windowstyle hidden -Command "Add-Type -AssemblyName System.Windows.Forms; [Windows.Forms.Clipboard]::SetImage($([System.Drawing.Image]::Fromfile(\"%1\")))""

Save as CopyImageToClipboard.reg and apply.

I do not have enough reputation for adding a comment and hope this qualifies for a separate answer.

Uwe Keim
  • 2,112
Max
  • 31
3

You can use Nircmd.

nircmd clipboard copyimage sourcefile

Serodis
  • 442
surfasb
  • 22,896
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.

0

I found ClipSa on google, not tried it yet.

Not found anything to do the opposite yet though

mavhc
  • 156
-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
  • 138