Skip to content

Commit e9ce5cd

Browse files
author
Yap Jia Hong
committed
Added image data into the binary itself. All good on Windows.
1 parent 6986eb7 commit e9ce5cd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
2+
13
use eframe;
24
use pomot::App;
35

6+
const ICON: &[u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/", "pomot.png"));
7+
48
// When compiling natively:
59
#[cfg(not(target_arch = "wasm32"))]
610
fn main() {
7-
8-
let icon = image::open("pomot.png").expect("Failed to open icon path.").to_rgba8();
11+
let icon = image::load_from_memory(ICON)
12+
.expect("Failed to open icon path.")
13+
.to_rgba8();
914
let (icon_width, icon_height) = icon.dimensions();
1015
let native_options = eframe::NativeOptions {
1116
icon_data: Some(eframe::IconData {

0 commit comments

Comments
 (0)