GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / PrintBySize Method
A unique image identifier of the GdPicture image representing the image in use.
Specifies the x-coordinate (in inches) of the upper-left corner of the provided GdPicture image into the paper.
Specifies the y-coordinate (in inches) of the upper-left corner of the provided GdPicture image into the paper.
Specifies the width (in inches) of the provided GdPicture image into the paper.
Specifies the height (in inches) of the provided GdPicture image into the paper.
Example





In This Topic
PrintBySize Method (GdPictureImaging)
In This Topic
Prints a specified GdPicture image to the active printer with the specific size and the position.
Syntax
'Declaration
 
Public Function PrintBySize( _
   ByVal ImageID As Integer, _
   ByVal DstLeft As Single, _
   ByVal DstTop As Single, _
   ByVal Width As Single, _
   ByVal Height As Single _
) As GdPictureStatus
public GdPictureStatus PrintBySize( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Width,
   float Height
)
public function PrintBySize( 
    ImageID: Integer;
    DstLeft: Single;
    DstTop: Single;
    Width: Single;
    Height: Single
): GdPictureStatus; 
public function PrintBySize( 
   ImageID : int,
   DstLeft : float,
   DstTop : float,
   Width : float,
   Height : float
) : GdPictureStatus;
public: GdPictureStatus PrintBySize( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Width,
   float Height
) 
public:
GdPictureStatus PrintBySize( 
   int ImageID,
   float DstLeft,
   float DstTop,
   float Width,
   float Height
) 

Parameters

ImageID
A unique image identifier of the GdPicture image representing the image in use.
DstLeft
Specifies the x-coordinate (in inches) of the upper-left corner of the provided GdPicture image into the paper.
DstTop
Specifies the y-coordinate (in inches) of the upper-left corner of the provided GdPicture image into the paper.
Width
Specifies the width (in inches) of the provided GdPicture image into the paper.
Height
Specifies the height (in inches) of the provided GdPicture image into the paper.

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.

Example
Printing a portion of an image using the default printer.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    // Open an image file. An empty string allows the control to prompt for selecting a file.
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
 
    float dstLeft = 2, dstTop = 2;
    float width = 10, height = 50;
 
    gdpictureImaging.PrintBySize(imageID, dstLeft, dstTop, width, height);
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(imageID);
See Also