GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / CreateThumbnailHQ Method / CreateThumbnailHQ(Int32,Int32,Int32,GdPictureColor) Method
GdPicture image identifier. The image from which the HQ thumbnail must be created.
The width of the thumbnail to create.
The height of the thumbnail to create.
Background color of the thumbnail. A suitable color value can be obtained by using the ARGB() method.
Example





In This Topic
CreateThumbnailHQ(Int32,Int32,Int32,GdPictureColor) Method
In This Topic
Creates a High Quality thumbnail of custom size from a GdPicture image. This method fits the image thumbnail within a rectangle of specified dimensions having a specified background color.
Syntax
'Declaration
 
Public Overloads Function CreateThumbnailHQ( _
   ByVal ImageID As Integer, _
   ByVal Width As Integer, _
   ByVal Height As Integer, _
   ByVal BackColor As GdPictureColor _
) As Integer
public int CreateThumbnailHQ( 
   int ImageID,
   int Width,
   int Height,
   GdPictureColor BackColor
)
public function CreateThumbnailHQ( 
    ImageID: Integer;
    Width: Integer;
    Height: Integer;
    BackColor: GdPictureColor
): Integer; 
public function CreateThumbnailHQ( 
   ImageID : int,
   Width : int,
   Height : int,
   BackColor : GdPictureColor
) : int;
public: int CreateThumbnailHQ( 
   int ImageID,
   int Width,
   int Height,
   GdPictureColor BackColor
) 
public:
int CreateThumbnailHQ( 
   int ImageID,
   int Width,
   int Height,
   GdPictureColor BackColor
) 

Parameters

ImageID
GdPicture image identifier. The image from which the HQ thumbnail must be created.
Width
The width of the thumbnail to create.
Height
The height of the thumbnail to create.
BackColor
Background color of the thumbnail. A suitable color value can be obtained by using the ARGB() method.

Return Value

GdPicture image identifier. The thumbnail Image. The ReleaseGdPictureImage() method must be subsequently used to release the image from the memory.
Example
Generating a high quality custom size thumbnail from a jpeg image with a background color.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg");
 
    // Create a thumbnail with a black background that is 100 pixels width and 200 pixels height.
    int thumbnailID = gdpictureImaging.CreateThumbnailHQ(imageID, 100, 200, Color.Black);
    gdpictureImaging.SaveAsPNG(thumbnailID, "thumbnail.png");
 
    // Release used resources.
    gdpictureImaging.ReleaseGdPictureImage(thumbnailID);
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also