Drag and Drop an image from a Canvas

I generate an image in a Canvas and I add a Drag and Drop feature, but I have a problem with it.

More specifically, beside the DragItem.Destination who is always Nil (read my other report), in the below if block, only the If line generate the png file in the Mouse released folder.

Used If block:

// Store the larger or the standard image If Keyboard.OSKey Then // Larger image size My_Pict = Custom_Large_Pict Else // Standard Image size My_Pict = Me.Backdrop End If

In short, I generate a large (less that 600 x 600 pixels @ 72 dpi) image that I resize to the definitive size (called stardard above). IfI press the OSKey (Cmd on MacOS, not yet tested on WIndows 10), the code will save the larger image. This never happens.

But: the smaller image is always saved / when I click in the Save Larger PushButton, my larger file is saved.
Also: the DragPicture is the larger one.

The code is in Canvas.MouseDrag (MouseDown only have Return True).

PS: I had to reboot yesterday to make the project save the drag to disk. Before that (changing nothing but Internet OFF and FireFox not running), I made no change at all.

@Emile Schwarz —Maybe using AsyncOSKey instead?

Thanks Stphane for your reply,

No, this part works fine, else I do not saw the larger image in both drag time and in the debugger.

I will try to migrate the code into a brand new project (I have a folder with a window and a FileType, so four Copy/Paste et voil).

After further research and an afternoon nap, it happens that it is a bug that have been squashed somewhere in the past.

My code as is works fine with 2019r1.1.

Nota: I created a brand new Project file, one Copy / Paste (the Folder where everything resides per design) and run… after a reboot (no Internet / no Firefox).
I’ve made a simple check with 2015r1 that does not works, then quit it and runs 2019r1 who worked fine.