Save an image as a file directly from the clipboard


What is the quickest way in Windows (7) to make or save a file of an image which has been placed on the clipboard? For example:

    1) Pressing Ctrl+PrtScr saves an image of the entire screen to the clipboard so that when Paste (Ctrl+v) is pressed, the image is pasted into the current active application. Pressing Alt+PrtScr does the same thing but only with the current active window.

    2) Alternatively, one can use the Snipping Tool to capture a user-defined rectangular area on the screen. In this case, once the image is captured, the option is available to bame and save the image as a file.

What I am wondering is how to quickly or most quickly save the image captured in example #1 — or is it even possible to create a file out of something which is only on the clipboard but not on the screen?

The method I've used in the past (for #1) is to paste the saved image into Excel or Word, and then by right-clicking, go through the steps of saving the image. But is there a quicker or more direct approach than that?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

#3) If you have an image in your clipboard and want to save it, please use an image program and save it as image. You've got at least paint for it. Don't make a big document or spread sheet from a simple image.

#1) With build in tools I don't know a way

#2) I use screenpresso which has a working directory and save all screen shots while creating. Besides full screen and specific window it can also snap only partial controls or tabs within a window.

#4) Have a look at this:
I bookmarked it a while ago but hadn't the time to test yet.
Joe WinogradDeveloperCommented:
Hi Steve,

For your #1, my fav go-to app is the excellent (and free!) IrfanView, imaging software that I've been using for many years:

Click the Download link on the left to download IrfanView and click the PlugIns link on the left to download the PlugIns, which are needed to give you PDF capability (it's optional...only if you want PDF support...and the other features that come with the PlugIns). Install IrfanView first, then install the PlugIns (again, it's optional, but I think it's a good idea).

To do what you want, run IrfanView and click Ctrl-V (paste) – that's it! Save it to whatever file and file type you want (I typically use JPG). Although I love IrfanView, many programs will accept the Ctrl-V, even the built-in Paint applet.

For your #2, I set up my shortcut for the Snipping Tool to have a hotkey:

Snipping Tool hotkeyI chose the numeric keypad minus sign, since I don't generally use the numeric keypad, and that key is very convenient, sitting in the upper right corner. I do a lot of screenshots for EE posts and EE articles, so I like having the Snipping Tool one keystroke away...and then I just click the Save icon to save the file to a JPG.

In both cases, you get a JPG (or other image file format, if you prefer) directly, rather than going through Excel or Word. Btw, I wrote a couple of articles about embedding screenshots that you may (or may not) find helpful:

Regards, Joe

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
+99 for Irfanview.  I use it almost everyday and probably for every image I have posted here.
Get Blueprints for Increased Customer Retention

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

byundtMechanical EngineerCommented:
Assuming that you are using Excel, here is a macro that will paste the clipboard contents to a cell just to the right of the usedrange, put it in a chart object and then export that chart object as an image file (.gif, .png, jpg, .jpe or .jpeg) using a user-specified file name. If the user specifies a path, it will be used. If not, the path will be the same as the active workbook.
Sub ExportClipboardToFile()
Dim cht As ChartObject
Dim sWidth As Single, sHeight As Single
Dim shp As ShapeRange
Dim celHome As Range, rg As Range
Dim flExtension As String, flName As String, flPath As String
On Error Resume Next
Set celHome = ActiveCell
flPath = ActiveWorkbook.path & Application.PathSeparator
flName = InputBox("Please enter the desired filename & extension to save clipboard image. Include the path if not same as activeworkbook.")
If flName <> "" Then
    flExtension = Mid("." & flName, InStrRev(flName, ".") + 2)
    If IsError(Application.Match(flExtension, Array("gif", "png", "jpg", "jpe", "jpeg"), 0)) Then
        MsgBox "File name must include extension .gif, .png, jpg, .jpe or .jpeg"
        If InStr(1, flName, Application.PathSeparator) = 0 Then flName = flPath & flName    'flName doesn't include the path, so add it
        Application.ScreenUpdating = False
        With ActiveSheet
            Set rg = .UsedRange
            Set rg = rg.Cells(1, 1).Offset(0, rg.Columns.Count)
            SendKeys "^v"
            Application.Wait Now + TimeValue("00:00:01")
            sWidth = Selection.Width
            sHeight = Selection.Height
            Set cht = .ChartObjects.Add(rg.Left, rg.Top, sWidth + 10, sHeight + 10)
            With cht
              .Chart.Export flName
            End With
            Application.Goto celHome
        End With
    End If
End If
End Sub

Open in new window

Steve_BradyAuthor Commented:
Thanks for the great suggestions and code.
Joe WinogradDeveloperCommented:
You're welcome. As always, happy to help.

That is a great piece of code!

Regards, Joe
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.