diff --git a/native-windows-gui/src/resources/bitmap.rs b/native-windows-gui/src/resources/bitmap.rs index 6791fd5a..4129520a 100644 --- a/native-windows-gui/src/resources/bitmap.rs +++ b/native-windows-gui/src/resources/bitmap.rs @@ -262,7 +262,7 @@ impl<'a> BitmapBuilder<'a> { let handle = unsafe { rh::build_oem_image(OemImage::Bitmap(src), self.size)? }; *b = Bitmap { handle, owned: true }; } else if let Some(src) = self.source_bin { - let handle = unsafe { rh::bitmap_from_memory(src)? }; + let handle = unsafe { rh::bitmap_from_memory(src, self.size)? }; *b = Bitmap { handle, owned: true }; } else { diff --git a/native-windows-gui/src/win32/resources_helper.rs b/native-windows-gui/src/win32/resources_helper.rs index 027ef802..a61ac186 100644 --- a/native-windows-gui/src/win32/resources_helper.rs +++ b/native-windows-gui/src/win32/resources_helper.rs @@ -283,8 +283,8 @@ pub unsafe fn bitmap_from_memory(source: &[u8]) -> Result { The memory must contain the whole file (including the file header). */ #[cfg(feature="image-decoder")] -pub unsafe fn bitmap_from_memory(src: &[u8]) -> Result { - build_image_decoder_from_memory(src, None) +pub unsafe fn bitmap_from_memory(src: &[u8], size: Option<(u32, u32)>) -> Result { + build_image_decoder_from_memory(src, size) } #[cfg(feature="image-decoder")]