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

Copy Method

Example 





Handle to the active window.
The image to be copied.
Indicates how image data is placed on the clipboard.
Copies the RGB or raster image data from a specified image to the Windows clipboard.
Syntax
public static void Copy( 
   IWin32Window owner,
   RasterImage image,
   RasterClipboardCopyFlags flags
)
'Declaration
 
Public Shared Sub Copy( _
   ByVal owner As IWin32Window, _
   ByVal image As RasterImage, _
   ByVal flags As RasterClipboardCopyFlags _
) 
'Usage
 
Dim owner As IWin32Window
Dim image As RasterImage
Dim flags As RasterClipboardCopyFlags
 
RasterClipboard.Copy(owner, image, flags)
public static void Copy( 
   IWin32Window owner,
   RasterImage image,
   RasterClipboardCopyFlags flags
)
 function Leadtools.WinForms.RasterClipboard.Copy( 
   owner ,
   image ,
   flags 
)
public:
static void Copy( 
   IWin32Window^ owner,
   RasterImage^ image,
   RasterClipboardCopyFlags flags
) 

Parameters

owner
Handle to the active window.
image
The image to be copied.
flags
Indicates how image data is placed on the clipboard.
Remarks
The clipboard will contain the same Leadtools.RasterImage.Width, Leadtools.RasterImage.Height, Leadtools.RasterImage.BitsPerPixel, and color Leadtools.RasterImage.Order as the image.
Example
 
Public Sub RasterClipboard_Copy(ByVal viewer As RasterImageViewer)
      Dim codec As RasterCodecs = New RasterCodecs()
      ' Load a bitmap, keeping its own bits per pixel
      Dim image As RasterImage = codec.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"))

      ' Copy the bitmap to the clipboard
      RasterClipboard.Copy(viewer, image, RasterClipboardCopyFlags.Empty Or RasterClipboardCopyFlags.Dib)
      ' Dispose the original bitmap, leaving the copy in the clipboard
      image.Dispose()

      MessageBox.Show("Image copied to clipboard")
   End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void RasterClipboard_Copy(RasterImageViewer viewer)
   {
      RasterCodecs codec = new RasterCodecs();
      // Load a bitmap, keeping its own bits per pixel
      RasterImage image = codec.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"));

      // Copy the bitmap to the clipboard
      RasterClipboard.Copy(viewer, image, RasterClipboardCopyFlags.Empty | RasterClipboardCopyFlags.Dib);
      // Dispose the original bitmap, leaving the copy in the clipboard
      image.Dispose();

      MessageBox.Show("Image copied to clipboard");
   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
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.