Skip to content

Commit

Permalink
Fix the fetching of images in CF_DIB format in DisplayServerWindows::…
Browse files Browse the repository at this point in the history
…clipboard_get_image

Fix the fetching of images from windows clipboard, if they're in CF_DIB format (e. g. by taking screenshots).

Image::create_from_data was used with an instance of Image, but it's a static function, returning a new instance.
  • Loading branch information
FaycalElOuariachi committed Feb 12, 2024
1 parent 4e990cd commit c1ec036
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions platform/windows/display_server_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,7 @@ Ref<Image> DisplayServerWindows::clipboard_get_image() const {
pba.append(rgbquad->rgbReserved);
}
}
image.instantiate();
image->create_from_data(info->biWidth, info->biHeight, false, Image::Format::FORMAT_RGBA8, pba);
image = Image::create_from_data(info->biWidth, info->biHeight, false, Image::Format::FORMAT_RGBA8, pba);

GlobalUnlock(mem);
}
Expand Down

0 comments on commit c1ec036

Please sign in to comment.