diff options
author | Faycal ElOuariachi <faycal.eloua@gmail.com> | 2024-02-12 13:14:11 +0100 |
---|---|---|
committer | Faycal ElOuariachi <faycal.eloua@gmail.com> | 2024-02-12 13:14:11 +0100 |
commit | c1ec0360e9ba65df1eec788f56c9d9fd7ac14b9b (patch) | |
tree | 8fbfdd2982a371eae023cc1ae22dd5738486f35a | |
parent | 4e990cd7e51d17cf24f854cc33b2715eaa27200f (diff) | |
download | redot-engine-c1ec0360e9ba65df1eec788f56c9d9fd7ac14b9b.tar.gz |
Fix the fetching of images in CF_DIB format in DisplayServerWindows::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.
-rw-r--r-- | platform/windows/display_server_windows.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index f0eec78b0d..e455055324 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -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); } |