mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/ElectronNET/Electron.NET/pull/394
State: closed
Merged: Yes
This is a long time running of reading documentation and source code within Electron/Chromium itself to see how the image handling is implemented.
The main conversion that happens in this bridge is that we have an array of (float)scaleFactor=>System.Drawing.Image. We serialize these by creating a json object with the scaleFactor as the key, and a base64 encoded representation of the System.Drawing.Image. From there, we send over the serialized data. The javascript picks it up and creates an empty nativeImage. Then, we add all the representations with scale factor to the electron nativeImage.
Everything image manipulation-wise happens on the dotnet side. The only thing this is currently used for with the bridge is clipboard image reading/writing. Hopefully we can add NativeImage support to more things soon, such as Tray Icons, etc.