Difference between revisions of "Clipboard.Picture"

From Xojo Documentation

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

Revision as of 21:28, 16 July 2019

Property (As Picture )
aClipboard.Picture = newPictureValue
or
PictureValue = aClipboard.Picture

Supported for all project types and targets.

The picture on the Clipboard.

Sample Code

This code is in the Action event of a button. It tests whether a picture is on the Clipboard. If so, it assigns it to the Backdrop property of the Canvas. This causes the picture to appear in the control. It will be cropped to the size of the Canvas.

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