Difference between revisions of "Clipboard.PictureAvailable"

From Xojo Documentation

(SMBot: new page by automated transformation)
 
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{PropertyBox
+
{{MethodBox
 
| name=PictureAvailable
 
| name=PictureAvailable
 
| owner=[[Clipboard]]
 
| owner=[[Clipboard]]
 
| ownertype=class
 
| ownertype=class
 
| scope=public
 
| scope=public
| type=[[Boolean]]
+
| returntype=[[Boolean]]
| platform=all
+
| project=Desktop
 
| readonly=yes
 
| readonly=yes
 
}}
 
}}
Returns [[True]] if the Clipboard contains a picture.
+
{{Description
 +
|text = 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.
 +
<rbcode>
 +
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
 +
</rbcode>

Latest revision as of 21:32, 9 December 2020

Method

Clipboard.PictureAvailable() As Boolean

Supported on Desktop.

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