Imports Leadtools.WinForms
Imports Leadtools
Imports Leadtools.Codecs
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
             
   
     
            using Leadtools.WinForms;
using Leadtools;
using Leadtools.Codecs;
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";
}