golang-design / clipboard

📋 cross-platform clipboard package that supports accessing text and image in Go (macOS/Linux/Windows/Android/iOS)
https://golang.design/x/clipboard
MIT License
585 stars 64 forks source link

all: add Windows support #1

Closed changkun closed 3 years ago

changkun commented 3 years ago

This PR adds windows support for clipboard access. It is worth mentioning that Windows uses bitmap encoding for storing images in the global clipboard, whereas this package assumes that all clipboard data are PNG encoded (for alpha blending purpose). This means there is always a conversion cost from PNG to bitmap when copying and the bitmap to PNG when pasting.