Canvas.AcceptPictureDrop

I am trying to implement the example described at http://documentation.xojo.com/index.php/RectControl.AcceptPictureDrop

Canvas.Open :

Me.AcceptPictureDrop

Canvas.DropObject:

If obj.PictureAvailable Then Me.Backdrop = obj.Picture End If

It simply does not work. Canvas.DropObject is not raised when I drop a picture file over the canvas :frowning:

Am I missing something ?

Where does the image come from? If it is a file, you need to use AcceptFileDrop. AcceptPictureDrop is for images dragged from other applications directly (for example an image from a website).

I was trying to drag a file. I understand better now. Thank you.

Attention Michel,

sous OS X Cocoa, il y a un bug: tu peux dposer sur ton Canvas un fichier autre que celui/ceux dfinis and acceptfiledrop.

Lorsque tu auras fait fonctionner le dposer de fichier images, essaie donc un ficher texte (txt) ou un dossier, juste pour voir.

Jai cr un bug report sur ce suk-jet, mais je ne sais pas sils ont compris (chez Xojo).

Google translation:

Warning Michel,

OS X Cocoa, there is a bug: you can drop a file on your Canvas other than that / those defined and acceptfiledrop.

When you have operated the drop image file, so try a text file (txt) or folder, just to see.

I created a bug report on this suk-jet, but I do not know if they understood (at Xojo).

[quote=74515:@Markus Winter]Google translation:

Warning Michel,

OS X Cocoa, there is a bug: you can drop a file on your Canvas other than that / those defined and acceptfiledrop.

When you have operated the drop image file, so try a text file (txt) or folder, just to see.

I created a bug report on this suk-jet, but I do not know if they understood (at Xojo).[/quote]

I had noticed that. I test the extension before processing.

Thank you.

[quote=74511:@Emile Schwarz]sous OS X Cocoa, il y a un bug: tu peux déposer sur ton Canvas un fichier autre que celui/ceux définis and acceptfiledrop.

[/quote]
Bien noté. Merci.

It was implicit, but that bug does not affect other platforms (Linux / Windows).