Copy image from VSCODE

What is the correct way to copy an image from the edit area, in VSCode?
When using the copy command (right click on the image) the image is not copied, to be able to copy it in Word, Paint, …, etc.

You could try and save the plot as an image (or pdf), see
https://stackoverflow.com/questions/62981391/how-to-save-plot-in-julia

Perhaps even better reference is the manual Output · Plots.

If I understood correctly, you want to directly copy the image from VSCode to the clipboard, without saving it to disk as an intermediate step.

For me, it only worked if I selected the image first (i.e. dragging my mouse (starting outside the image borders) over the image until it was highlighted blue) and then right-clicking and selecting Copy.
Although I agree it would be slightly more convenient if one could just directly use right-click → Copy.

Yes, is that or what I’m looking for.
I just did the procedure you describe, and I can’t copy it, in word or paint. Apparently there is no copy of the image on clickboard

We’ll get native support for this soonish, hopefully:

5 Likes

I assume you are on Windows? The procedure described (highlighting the image first and then copying) worked for me on Linux (Ubuntu 20.04), I was then able to paste it with CTRL+V into LibreOffice.

Unfortunately I do not have access to a Windows setup to try it out there… Sorry I couldn’t be of more help! But it is good to know a native julia-vscode extension solution seems to be on the horizon.

On MacOS, you can drag the plot to Chrome, where it opens as an .svg. Very handy!

This works on Windows with Chrome as well. Then you can right-click and save as a file.

Didn’t work with Firefox or Edge, though.

I guess another workaround would be a screen clip with the Snipping Tool or Snip & Sketch for Windows and Command + Shift + 4 on Mac.

@pfitzseb, looking forward to the next minor release with this PR!

1 Like

Same problem here in 2024 (Ubuntu 20.04) … I have never been able to copy plots from VSCode to be honest, either right click or going into the Julia menu “Copy plot”.

Of course I can save the plot, but just copy/paste sometimes would be more convenient.

I haven’t understood the “workaround” proposed by some of you…