RectControl.AcceptPictureDrop

From Xojo Documentation

Method

RectControl.AcceptPictureDrop()

Supported for all project types and targets.

Permits pictures to be dropped on the control. Use this method to accept pictures dropped directly from another application such as a web browser. If you want to accept pictures that come from the file system (using Finder or Windows Explorer) you need to use AcceptFileDrop.

Notes

If a control should accept pictures in a drag and drop, then AcceptPictureDrop needs to be called prior to the drop. Typically, it is in the Open event of the control itself. For example, the line:

Me.AcceptPictureDrop

in the Open event of the control that will receive the dragged pictures is needed. When the picture is dropped, the DropObject event is called and this is where you will put your code to handle the drop.

Example

Canvas.Open:

Me.AcceptPictureDrop

Canvas.DropObject:

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