You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

github.com/skanehira/clipboard-image/v2

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/skanehira/clipboard-image/v2


Version published

Readme

Source

clipboard-image

Copy image to clipboard

Supported OS

  • Windows
  • Mac
  • Linux/Unix

Requirements

  • xclip(linux only)

Usage

Copy image file to clipboard.

f, err := os.Open("image.png")
if err != nil {
	log.Fatal(err)
}
deder f.Close()

if err := clipboard.CopyToClipboard(f); err != nil {
	log.Fatal(err)
}

Read image file from clipboard.

r, err := clipboard.ReadFromClipboard()
if err != nil {
	log.Fatal(err)
}

f, err := os.Create("image.png")
if err != nil {
	log.Fatal(err)
}
defer f.Close()

if _, err := io.Copy(f, r); err != nil {
	log.Fatal(err)
}

Author

skanehira

FAQs

Package last updated on 11 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc