Difference between revisions of "Clipboard.PictureAvailable"

From Xojo Documentation

Line 12: Line 12:
  
 
== Sample Code ==
 
== Sample Code ==
The following code is in the Action event of a button. If a picture is on the Clipboard, it assigns it to the Backdrop property of a [[Canvas]]. The result is that the picture appears immediately.
+
The following code is in the Presssed event of a button. If a picture is on the Clipboard, it assigns it to the Backdrop property of a [[Canvas]]. The result is that the picture appears immediately.
 
<rbcode>
 
<rbcode>
 
Var c As Clipboard
 
Var c As Clipboard

Revision as of 21:30, 16 July 2019

Method

Clipboard.PictureAvailable() As Boolean

Supported for all project types and targets.

Returns True if the Clipboard contains a picture.

Sample Code

The following code is in the Presssed event of a button. If a picture is on the Clipboard, it assigns it to the Backdrop property of a Canvas. The result is that the picture appears immediately.

Var c As Clipboard

// create a new instance of the clipboard
c = New Clipboard

// check to see if a picture is available
If c.PictureAvailable Then
Var myPicture As Picture
myPicture = c.Picture // get the picture
Canvas1.Backdrop = myPicture // set the backdrop
End If

// close the clipboard
c.Close