GdPicture.NET Reference Guide
JPEGLosslessCrop Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : JPEGLosslessCrop Method
The source JPEG image.
The destination JPEG image.
The left position, in pixel, of the area to crop.
The top position, in pixel, of the area to crop.
The width, in pixel, of the area to crop.
The height, in pixel, of the area to crop.
Performs a lossless crop on a JPEG image.
Syntax
'Declaration
 
Public Function JPEGLosslessCrop( _
   ByVal SrcFile As String, _
   ByVal DstFile As String, _
   ByVal Left As Integer, _
   ByVal Top As Integer, _
   ByVal Width As Integer, _
   ByVal Height As Integer _
) As GdPictureStatus
public function JPEGLosslessCrop( 
    SrcFile: String;
    DstFile: String;
    Left: Integer;
    Top: Integer;
    Width: Integer;
    Height: Integer
): GdPictureStatus; 
public function JPEGLosslessCrop( 
   SrcFile : String,
   DstFile : String,
   Left : int,
   Top : int,
   Width : int,
   Height : int
) : GdPictureStatus;

Parameters

SrcFile
The source JPEG image.
DstFile
The destination JPEG image.
Left
The left position, in pixel, of the area to crop.
Top
The top position, in pixel, of the area to crop.
Width
The width, in pixel, of the area to crop.
Height
The height, in pixel, of the area to crop.

Return Value

A member of the GdPictureStatus enumeration.
Example
Cropping the JPEG file without loss of information.
Dim oGdPictureImaging As New GdPictureImaging
If oGdPictureImaging.JPEGLosslessCrop("input.jpg", "output.jpg", 0, 50, 150, 120) <> GdPictureStatus.OK Then
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members