mirror of
https://github.com/1Password/arboard.git
synced 2025-07-07 13:25:18 +00:00
15 lines
330 B
Rust
15 lines
330 B
Rust
use arboard::{Clipboard, ImageData};
|
|
|
|
fn main() {
|
|
let mut ctx = Clipboard::new().unwrap();
|
|
|
|
#[rustfmt::skip]
|
|
let bytes = [
|
|
255, 100, 100, 255,
|
|
100, 255, 100, 100,
|
|
100, 100, 255, 100,
|
|
0, 0, 0, 255,
|
|
];
|
|
let img_data = ImageData { width: 2, height: 2, bytes: bytes.as_ref().into() };
|
|
ctx.set_image(img_data).unwrap();
|
|
}
|