LEADTOOLS Windows Forms (Leadtools.WinForms assembly)
LEAD Technologies, Inc

Paste Method

Example 





Handle to the active window.
Copies image data from the clipboard.
Syntax
public static RasterImage Paste( 
   IWin32Window owner
)
'Declaration
 
Public Shared Function Paste( _
   ByVal owner As IWin32Window _
) As RasterImage
'Usage
 
Dim owner As IWin32Window
Dim value As RasterImage
 
value = RasterClipboard.Paste(owner)
public static RasterImage Paste( 
   IWin32Window owner
)
 function Leadtools.WinForms.RasterClipboard.Paste( 
   owner 
)
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.
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.
Example
 
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
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");
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RasterClipboard Class
RasterClipboard Members

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.