Skip to content

Commit

Permalink
fix CreateDIBSection
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Jun 3, 2021
1 parent ee4dc64 commit 82549bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -2896,6 +2896,7 @@ HBITMAP _app_bitmapfromico (_In_ HICON hicon, _In_ INT icon_size)
if (hdc)
{
BITMAPINFO bitmap_info = {0};
PVOID pbits;

bitmap_info.bmiHeader.biSize = sizeof (bitmap_info);
bitmap_info.bmiHeader.biPlanes = 1;
Expand All @@ -2905,7 +2906,7 @@ HBITMAP _app_bitmapfromico (_In_ HICON hicon, _In_ INT icon_size)
bitmap_info.bmiHeader.biHeight = icon_size;
bitmap_info.bmiHeader.biBitCount = 32;

hbitmap = CreateDIBSection (hdc, &bitmap_info, DIB_RGB_COLORS, NULL, NULL, 0);
hbitmap = CreateDIBSection (hdc, &bitmap_info, DIB_RGB_COLORS, &pbits, NULL, 0);

if (hbitmap)
{
Expand Down

0 comments on commit 82549bc

Please sign in to comment.