Hey y'all, Rust newbie here. For context, I am building a desktop app with Tauri and using arboard to read/write images from/to the clipboard. The writing part works fine but the part I am struggling with is taking the image I read from the clipboard and rendering it on the client so the user can view and edit the image.
Things I've tried in JS:
- Converting the
image.bytes into a blob/base64 string.
- Rendering the
image.bytes into a canvas.
Things I've tried in Rust:
In Rust, the file gets saved by when I open it, I just see this.
I think the issue is probably with my understanding of what image.bytes returns and how to use it to actually convert it into a PNG or any other format that I can use to display the image. I know the image itself is in the form of this ImageData struct but I don't really understand much beyond that.
Could someone help walk me through this or give me some pointers so I can further experiment with implementing this feature within my app?
Additional context: My dev environment is MacOS 12.4 and my frontend is written in React.
Hey y'all, Rust newbie here. For context, I am building a desktop app with Tauri and using
arboardto read/write images from/to the clipboard. The writing part works fine but the part I am struggling with is taking the image I read from the clipboard and rendering it on the client so the user can view and edit the image.Things I've tried in JS:
image.bytesinto a blob/base64 string.image.bytesinto a canvas.Things I've tried in Rust:
image.bytesto a file using this approach.In Rust, the file gets saved by when I open it, I just see this.
I think the issue is probably with my understanding of what
image.bytesreturns and how to use it to actually convert it into a PNG or any other format that I can use to display the image. I know the image itself is in the form of thisImageDatastruct but I don't really understand much beyond that.Could someone help walk me through this or give me some pointers so I can further experiment with implementing this feature within my app?
Additional context: My dev environment is MacOS 12.4 and my frontend is written in React.