I think this is just an issue with legacy programs. Using the README example, listenImageContent generates a transparent image when selecting and copying from MS Paint or Photoshop CS6 13.0. Pasting this same clipboard on a browser, works fine (i.e. this Github form)
Tested with Krita 5.1.5 and worked fine.
import { emit, listen} from "@tauri-apps/api/event";
import {
IMAGE_CHANGED,
listenImage,
} from "tauri-plugin-clipboard-api";
let listenTextContent = "";
let listenImageContent = "";
let tauriTextUnlisten;
let tauriImageUnlisten;
let textUnlisten: () => void;
let imageUnlisten: () => void;
export async function startListening() {
tauriImageUnlisten = await listen(IMAGE_CHANGED, (event) => {
console.log(event);
listenImageContent = event.payload.value;
});
imageUnlisten = listenImage();
}
function stopListening() {
imageUnlisten();
tauriImageUnlisten();
}
onMount(() => {
startListening();
});
onDestroy(() => {
stopListening();
});
Base64 from selecting an area and pressing Ctrl + C:
I think this is just an issue with legacy programs. Using the README example,
listenImageContent
generates a transparent image when selecting and copying from MS Paint or Photoshop CS6 13.0. Pasting this same clipboard on a browser, works fine (i.e. this Github form)Tested with Krita 5.1.5 and worked fine.
Base64 from selecting an area and pressing Ctrl + C:
Base64 from using Windows screenshot by pressing Windows + Shift + S: