←Select platform

Copy Method

Summary

Copies the RGB or raster image data from a specified image to the Windows clipboard.

Syntax
C#
C++/CLI
public static void Copy( 
   IntPtr owner, 
   RasterImage image, 
   RasterClipboardCopyFlags flags 
) 
public:  
   static void Copy( 
      System::IntPtr owner, 
      RasterImage^ image, 
      RasterClipboardCopyFlags^ flags 
   ) 

Parameters

owner

Handle to the active window (use System.Windows.Forms.Control.HandleControl.Handle).

image

The image to be copied.

flags

Indicates how image data is placed on the clipboard.

Remarks

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

Example
C#
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(LEAD_VARS.ImagesDir, "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(); 
   } 
 
   Debug.WriteLine("Image copied to clipboard"); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Controls Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.