Fix the fetching of images in CF_DIB
format in DisplayServerWindows::clipboard_get_image
#88220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A bug was occuring when trying to import an image from the windows clipbpoard, if it's in CF_DIB format (e. g. by taking screenshots). No image was returned.
It comes from a tiny error : in
DisplayServerWindows::clipboard_get_image
,Image::create_from_data
was used with an instance ofImage
, but since it's a static function, it returns a new instance instead of modifying the 'called' one.Correcting this fixes the importation.
Testing with a GDScript
This script was attached to a TextureRect node in the testing scene.
(At the start, the clipboard must contains an image in CF_DIB format, for instance a screenshot, or some images coming from a web navigator, in the right format, copied with the right-click context menu.)
PS : I apologies if my PR isn't conform to godot contributor's workflow, or for any other problem.