Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.4.3
|
Leadtools.Controls Assembly > Leadtools.Controls Namespace > RasterClipboard Class : Copy Method |
public static void Copy( IntPtr owner, RasterImage image, RasterClipboardCopyFlags flags )
'Declaration
Public Shared Sub Copy( _ ByVal owner As IntPtr, _ ByVal image As RasterImage, _ ByVal flags As RasterClipboardCopyFlags _ )
This example loads a bitmap using clipboard data, if available
Imports Leadtools Imports Leadtools.Controls Imports Leadtools.Codecs Public Sub RasterClipboard_Copy(ByVal imageViewer As ImageViewer) Using codec As RasterCodecs = New RasterCodecs() ' Load a bitmap, keeping its own bits per pixel Dim image As RasterImage = codec.Load(Path.Combine(ImagesPath.Path, "Image1.cmp"), 1) ' Copy the bitmap to the clipboard RasterClipboard.Copy(imageViewer.Handle, image, RasterClipboardCopyFlags.Empty Or RasterClipboardCopyFlags.Dib) ' Dispose the original bitmap, leaving the copy in the clipboard image.Dispose() End Using MessageBox.Show("Image copied to clipboard") End Sub
using Leadtools; using Leadtools.Controls; using Leadtools.Codecs; public void RasterClipboard_Copy() { using (RasterCodecs codec = new RasterCodecs()) { // Load a bitmap, keeping its own bits per pixel RasterImage image = codec.Load(Path.Combine(ImagesPath.Path, "Image1.cmp"), 1); // Copy the bitmap to the clipboard RasterClipboard.Copy(_imageViewer.Handle, image, RasterClipboardCopyFlags.Empty | RasterClipboardCopyFlags.Dib); // Dispose the original bitmap, leaving the copy in the clipboard image.Dispose(); } MessageBox.Show("Image copied to clipboard"); }