LEADTOOLS Windows Forms (Leadtools.WinForms assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
Paste Method
See Also 
Leadtools.WinForms Namespace > RasterClipboard Class : Paste Method



owner
Handle to the active window.
owner
Handle to the active window.
Copies image data from the clipboard.

Syntax

Visual Basic (Declaration) 
Public Shared Function Paste( _
   ByVal owner As IWin32Window _
) As RasterImage
Visual Basic (Usage)Copy Code
Dim owner As IWin32Window
Dim value As RasterImage
 
value = RasterClipboard.Paste(owner)
C# 
public static RasterImage Paste( 
   IWin32Window owner
)
C++/CLI 
public:
static RasterImage^ Paste( 
   IWin32Window^ owner
) 

Parameters

owner
Handle to the active window.

Return Value

A reference to a new RasterImage object created using the data in the Windows clipboard.

Example

This example loads a bitmap using clipboard data, if available

Visual BasicCopy Code
Public Sub RasterClipboard_Paste(ByVal viewer As RasterImageViewer)
   If RasterClipboard.IsReady Then
      ''' Copy the bitmap from the clipboard 
      viewer.Image = RasterClipboard.Paste(viewer)
      Console.WriteLine("Paste is Successful")
   Else
      Console.WriteLine("Paste Failed")
   End If
End Sub
C#Copy Code
public void RasterClipboard_Paste(RasterImageViewer viewer)
{
   if (RasterClipboard.IsReady)
   {
      /// Copy the bitmap from the clipboard 
      viewer.Image = RasterClipboard.Paste(viewer);
      Console.WriteLine("Paste is Successful");
   }
   else
   {
      Console.WriteLine("Paste Failed");
   }
}

Remarks

The image on the clipboard must be a DIB, DDB, or a WMF.
The image will contain the same Leadtools.RasterImage.Width, Leadtools.RasterImage.Height, and Leadtools.RasterImage.BitsPerPixel as the image contained in the clipboard.
The Leadtools.RasterImage.Order will be set to RasterByteOrder.Bgr. If the copied image is not in Bgr order, it is up to you to change its color Order using Leadtools.ImageProcessing.ColorResolutionCommand.
To determine whether a region was pasted, use Leadtools.RasterImage.HasRegion.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also