octref / polacode

📸 Polaroid for your code
https://marketplace.visualstudio.com/items?itemName=pnp.polacode
6.82k stars 182 forks source link

Copy image in polacode #132

Open Kevinwuu opened 4 years ago

Kevinwuu commented 4 years ago

When i need to make more than 1 screenshot, i think saving file for every picture it's kind of unnecessary. If i can just copy and paste the image to others and make the next one immediately, it will be great. 👍 I used to use Pickpic to make screenshot and it can do the same thing as i said.

Ranguna commented 4 years ago

Looks like this repo hasn't been active for a while. I want this feature too so I'll be switching to https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap

MillhioreBT commented 4 years ago

I agree with @Kevinwuu, I don't know how to compile and install changes on this extension, I would like to try if someone helps me.

Use:

const { copyImg } = require('img-clipboard');

copyImg(Buffer.from(imageData, 'base64'));

Example:

const writeSerializedBlobToFile = (serializeBlob, fileName) => {
  const bytes = new Uint8Array(serializeBlob.split(','))
  fs.writeFileSync(fileName, Buffer.from(bytes))
  copyImg(Buffer.from(bytes)) // <HERE>
}

this functionality can be achieved, pls if anyone knows how to install these changes help me.

djD-REK commented 4 years ago

Looks like this repo hasn't been active for a while. I want this feature too so I'll be switching to https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap

Thanks for the tip! https://github.com/kufii/CodeSnap