DEV Community

Cover image for Take a screenshot of VSCode using Polacode Extension
Arbaoui Mehdi
Arbaoui Mehdi

Posted on

Take a screenshot of VSCode using Polacode Extension

Sometimes I add some tweets that should include code, so we don't have the option to embed code on twitter, so for that, the only solution is to add an image, in this post I'll show you how to create a screenshot of your code from Visual Studio Code by using this extension Polacode

First, you've to install the extension, click on the Extensions icon on the left sidebar of your editor to open the extensions Market place, then type Polacode you'll find multiple ones, choose the one that has more downloads.

Install Polacode for vscode

Then we've to show the command palette by using the shortcut Cmd+Shift+P for Mac users, or Ctrl+P for Windows users, then type > Polacode

Access Polacode Extension

Open any file including code, in my case, I'm using a JavaScript as an example, select the code and it will be shown in the right of the editor.

take a screenshot using vscode

I save the file code.png on the Desktop folder, so open the file to see the result.

Open Polacode Result

Top comments (3)

Collapse
 
scottw profile image
Scott Watermasysk • Edited

The problem with code to image is accessibility. Ideally they would come with a link a a gist/etc with the actual code.

(edit) - It is still a really nice integration. :)

Collapse
 
arbaoui_mehdi profile image
Arbaoui Mehdi

I totally agree, embedding a gist or a codepen would be a better solution for accessibility.

Collapse
 
maninthehood profile image
maninthehood

I am floating right now. I am trying to do the same but I can't! Please help!