Sixem

.NET Get Image From Clipboard

Jul 20th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.60 KB | None | 0 0
  1. Dim Data As IDataObject = Clipboard.GetDataObject
  2.         If Data.GetDataPresent(DataFormats.FileDrop) Then
  3.             For Each i As String In Data.GetData(DataFormats.FileDrop)
  4.                 Dim ClipPath As String = Path.Combine(Path.GetFullPath(i))
  5.                 MessageBox.Show("Clipboard Image Path:" & ClipPath)
  6.             Next
  7.         Else
  8.             If Clipboard.ContainsImage() Then
  9.                 Dim Clip_Image As System.Drawing.Image = My.Computer.Clipboard.GetImage()
  10.             Else
  11.                 MessageBox.Show("Clipboard is not an image!")
  12.             End If
  13.         End If
Advertisement
Add Comment
Please, Sign In to add comment