GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / CopyRegionToClipboard Method
A unique image identifier of the GdPicture image representing the image in use.
The horizontal (X) coordinate of the top left position of the required region, in pixels.
The vertical (Y) coordinate of the top left position of the required region, in pixels.
The width of the required region, in pixels.
The height of the required region, in pixels.
Example





In This Topic
CopyRegionToClipboard Method (GdPictureImaging)
In This Topic
Copies the defined region of the specified GdPicture image represented by its unique image identifier into the clipboard.
Syntax
'Declaration
 
Public Function CopyRegionToClipboard( _
   ByVal ImageID As Integer, _
   ByVal SrcLeft As Integer, _
   ByVal SrcTop As Integer, _
   ByVal Width As Integer, _
   ByVal Height As Integer _
) As GdPictureStatus
public GdPictureStatus CopyRegionToClipboard( 
   int ImageID,
   int SrcLeft,
   int SrcTop,
   int Width,
   int Height
)
public function CopyRegionToClipboard( 
    ImageID: Integer;
    SrcLeft: Integer;
    SrcTop: Integer;
    Width: Integer;
    Height: Integer
): GdPictureStatus; 
public function CopyRegionToClipboard( 
   ImageID : int,
   SrcLeft : int,
   SrcTop : int,
   Width : int,
   Height : int
) : GdPictureStatus;
public: GdPictureStatus CopyRegionToClipboard( 
   int ImageID,
   int SrcLeft,
   int SrcTop,
   int Width,
   int Height
) 
public:
GdPictureStatus CopyRegionToClipboard( 
   int ImageID,
   int SrcLeft,
   int SrcTop,
   int Width,
   int Height
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the image in use.
SrcLeft
The horizontal (X) coordinate of the top left position of the required region, in pixels.
SrcTop
The vertical (Y) coordinate of the top left position of the required region, in pixels.
Width
The width of the required region, in pixels.
Height
The height of the required region, in pixels.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Just to inform you, that this method uses the Clipboard class of the .NET Framework.

This method requires the Image Documents component to run.

Example
Creating a new image from a specified area of an existing image using clipboard.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID1 = gdpictureImaging.CreateGdPictureImageFromFile("");
    // Copy the specified region of an image to clipboard.
    gdpictureImaging.CopyRegionToClipboard(imageID1, 50, 50, 100, 250);
    // Create a new image from clipboard data.
    int imageID2 = gdpictureImaging.CreateGdPictureImageFromClipboard();
    // Process newly created image.
    gdpictureImaging.FxSepia(imageID2);
    gdpictureImaging.SaveAsPNG(imageID2, "image.png");
    // Release used resources.
    gdpictureImaging.DeleteClipboardData();
    gdpictureImaging.ReleaseGdPictureImage(imageID1);
    gdpictureImaging.ReleaseGdPictureImage(imageID2);
}
See Also