ClipboardProxy.GetImage 方法

定義

從剪貼簿中取出一張圖片。

public:
 System::Drawing::Image ^ GetImage();
public System.Drawing.Image GetImage();
member this.GetImage : unit -> System.Drawing.Image
Public Function GetImage () As Image

傳回

Image表示剪貼簿影像資料,或Nothing是剪貼簿中沒有任何格式內Bitmap的資料,或可轉換成該格式。

範例

此範例會先檢查剪貼簿上是否有圖片,再取回並指派給 PictureBox1

If My.Computer.Clipboard.ContainsImage() Then
   Dim grabpicture = My.Computer.Clipboard.GetImage()
   PictureBox1.Image = grabpicture
End If

這個範例要正常運作,表單上必須有一個 PictureBox 名稱 PictureBox1

備註

依專案類型提供可用性

專案類型 Available
Windows 應用程式 Yes
類別庫 Yes
主控台應用程式 Yes
Windows 控件庫 Yes
Web 控制庫 No
Windows 服務 Yes
網站 No

適用於

另請參閱