Explorar o código

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.
(cherry picked from commit c1ec0360e9ba65df1eec788f56c9d9fd7ac14b9b)
Faycal ElOuariachi hai 1 ano
pai
achega
1f0cf81f57
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      platform/windows/display_server_windows.cpp

+ 1 - 2
platform/windows/display_server_windows.cpp

@@ -554,8 +554,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);
 			}