gabdube / native-windows-gui

A light windows GUI toolkit for rust
https://gabdube.github.io/native-windows-gui/
MIT License
1.93k stars 125 forks source link

Bitmap builder fails with loading BITMAP embedded images (works with a file.bmp) #295

Open eugenesvk opened 2 months ago

eugenesvk commented 2 months ago

Your suggeston from https://github.com/gabdube/native-windows-gui/issues/185 to use IMAGE works, but it's still weird that I can load the same file standalone, but not when embedded

A modified tray app example with embedded bmp image is here

(using your repo's bmp file so it shouldn't be format issues)

nickbeth commented 1 month ago

This might be because you're using an older version of embed-resource crate, try using the latest version (v2.4). It definitely worked for me with the latest version when I tried it last month.

eugenesvk commented 1 month ago

Didn't help, updated the example to v2.4

Do you mean your wsl-usb-manager? I doesn't seem to have a Bitmap builder, but an icon from the embedded string

Or is there a different working example you could point to?

nickbeth commented 1 month ago

During the development of wsl-usb-manager I tried displaying a bitmap as the image of a tray notification, and I was able to retrieve the app icon BMP from the resource manifest. I scrapped that feature in the end, so there is no code example I can show you sadly.