Leadtools.WinForms Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.8.31
Copy Method
See Also  Example
Leadtools.WinForms Namespace > RasterClipboard Class : Copy Method




owner
Handle to the active window.
image
The image to be copied.
flags
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

Visual Basic (Declaration) 
Public Shared Sub Copy( _
   ByVal owner As IWin32Window, _
   ByVal image As RasterImage, _
   ByVal flags As RasterClipboardCopyFlags _
) 
Visual Basic (Usage)Copy Code
Dim owner As IWin32Window
Dim image As RasterImage
Dim flags As RasterClipboardCopyFlags
 
RasterClipboard.Copy(owner, image, flags)
C# 
public static void Copy( 
   IWin32Window owner,
   RasterImage image,
   RasterClipboardCopyFlags flags
)
Managed Extensions for C++ 
public: static void Copy( 
   IWin32Window owner,
   RasterImage image,
   RasterClipboardCopyFlags flags
) 
C++/CLI 
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.

Example

This example loads a bitmap using clipboard data, if available

Visual BasicCopy Code
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("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\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
C#Copy Code
public void RasterClipboard_Copy(RasterImageViewer viewer) 

   RasterCodecs codec = new RasterCodecs(); 
   // Load a bitmap, keeping its own bits per pixel 
   RasterImage image = codec.Load(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\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"); 
}

Remarks

The clipboard will contain the same Width, Height, BitsPerPixel, and color Order as the image.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also