-
-
Notifications
You must be signed in to change notification settings - Fork 734
Implement NativeImage support, fixes #14 #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Wow! Thanks for your great work! I will do a review as soon as possible and deliver it to our next update. |
Do you have an idea why the build fails with Travis-CI? |
Did you bring everything together on the basis of Electron.NET 8.31.1? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Gregor, let me look into why the demo app is not working for you. I just pulled upstream master, and ran the app, and it seemed to work for me. The box next to copy is for pasting images into, i.e ctrl+v. I've attached a video to show you the demo, as seen below. Thanks! |
Thank you very much for the great work! With the next update 8.31.2 your feature will be included :) That enriches the community very much ... if you send me your address via Gitter, I can send you Electron.NET stickers if you want :) We have the demo app again separately.. would be cool if you could test it there again... as soon as our update has been published, it will also be used there: |
I will submit a PR soon with changes to the demo that includes the support for showing off the copy + paste for clipboard and images. |
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.