My.Computer.Clipboard.SetImage Method

Writes an image to the Clipboard.

' Usage
My.Computer.Clipboard.SetImage(image)
' Declaration
Public Sub SetImage( _
   ByVal image As System.Drawing.Image _
)

Parameters

  • image
    Image. Image to be written. Required.

Remarks

Security noteSecurity Note:

Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data.

Example

This example writes the image coolPicture to the Clipboard.

My.Computer.Clipboard.SetImage(coolPicture)

This example depends on the existence of the image coolPicture.

Requirements

Namespace:Microsoft.VisualBasic.MyServices

Class:ClipboardProxy (provides access to Clipboard)

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type

Available

Windows Application

Yes

Class Library

Yes

Console Application

Yes

Windows Control Library

Yes

Web Control Library

No

Windows Service

Yes

Web Site

No

Permissions

No permissions are required.

See Also

Tasks

How to: Retrieve an Image from the Clipboard in Visual Basic

Reference

My.Computer.Clipboard Object

System.Drawing.Image

Clipboard.SetImage

My.Computer.Clipboard.ContainsImage Method

My.Computer.Clipboard.GetImage Method

Other Resources

Storing Data to and Reading From the Clipboard