Paste Method (original) (raw)
Summary
Copies image data from the clipboard.
Syntax
C#
C++/CLI
public static [RasterImage](../l/rasterimage.html) Paste(
IntPtr _owner_
)
public:
static [RasterImage](../l/rasterimage.html)^ Paste(
System::IntPtr _owner_
)
Parameters
owner
Handle to the active window (use System.Windows.Forms.Control.HandleControl.Handle).
Return Value
A reference to a new RasterImage object created using the data in the Windows clipboard.
Remarks
The image on the clipboard must be a DIB, DDB, or a WMF.
The image will contain the same Width, Height, and BitsPerPixel as the image contained in the clipboard.
The Order will be set to RasterByteOrder.Bgr. If the copied image is not in Bgrorder, it is up to you to change its color Order using ColorResolutionCommand.
To determine whether a region was pasted, use HasRegion.
Example
C#
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
public void RasterClipboard_Paste()
{
if (RasterClipboard.IsReady)
{
/// Copy the bitmap from the clipboard
_imageViewer.Image = RasterClipboard.Paste(_imageViewer.Handle);
Debug.WriteLine("Paste is Successful");
}
else
{
Debug.WriteLine("Paste Failed");
}
}