Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moisutsu/imboard
This crate makes it convenient to exchange images with the clipboard
https://github.com/moisutsu/imboard
clipboard rust
Last synced: 27 days ago
JSON representation
This crate makes it convenient to exchange images with the clipboard
- Host: GitHub
- URL: https://github.com/moisutsu/imboard
- Owner: moisutsu
- License: mit
- Created: 2020-08-08T13:38:43.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-22T05:31:46.000Z (about 3 years ago)
- Last Synced: 2024-09-14T05:29:04.177Z (about 2 months ago)
- Topics: clipboard, rust
- Language: Rust
- Homepage: https://crates.io/crates/imboard
- Size: 71.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Imboard
[![Crates.io](https://img.shields.io/crates/v/imboard.svg)](https://crates.io/crates/imboard)
[![Documentation](https://docs.rs/imboard/badge.svg)](https://docs.rs/imboard)
![License](https://img.shields.io/crates/l/imboard.svg)This is a crate that allows you to easily exchange images with the clipboard.
Currently, only macOS is supported.
# Example
Save a clipboard image to a file as `clipboard.png`
```rust
use anyhow::Result;#[tokio::main]
async fn main() -> Result<()> {
let img = imboard::copy_image::from_clipboard().await?;
img.to_rgba().save("clipboard.png").unwrap();
Ok(())
}
```Copy a file image to the clipboard
```rust
use anyhow::Result;#[tokio::main]
async fn main() -> Result<()> {
let img = image::open("examples/images/copy.png")?;
imboard::copy_image::to_clipboard(img).await?;
Ok(())
}
```