GdPicture.NET Reference Guide
GetResizedGdPictureImage Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : GetResizedGdPictureImage Method
GdPicture Image Identifier. The image to release.
New image width in pixel.
New image height in pixel.
A member of the Drawing2D.InterPolationMode enumeration.
Creates a resized GdPicture image from a GdPicture Image.
Syntax
'Declaration
 
Public Function GetResizedGdPictureImage( _
   ByVal ImageID As Integer, _
   ByVal NewImageWidth As Integer, _
   ByVal NewImageHeight As Integer, _
   ByVal InterpolationMode As InterpolationMode _
) As Integer
public function GetResizedGdPictureImage( 
   ImageID : int,
   NewImageWidth : int,
   NewImageHeight : int,
   InterpolationMode : InterpolationMode
) : int;

Parameters

ImageID
GdPicture Image Identifier. The image to release.
NewImageWidth
New image width in pixel.
NewImageHeight
New image height in pixel.
InterpolationMode
A member of the Drawing2D.InterPolationMode enumeration.

Return Value

- 0: Failure. Use the GetStat() method to determine the reason this method failed. - Non-zero: GdPicture Image Identifier. The created image. The ReleaseGdPictureImage() method must be subsequently used to release the image from the memory.
Remarks
This method automatically adjusts the vertical and horizontal image resolution in order to maintain the aspect ratio. If the intention is to change the aspect ratio, the SetVerticalResolution() and/or SetVHorizontalResolution() methods should be used instead.
Example
Creating a resized copy of an image that is equal to half the width and height of the original.
Dim oGdPictureImaging As New oGdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   Dim ResizedImage As Integer
   ResizedImage = oGdPictureImaging.GetResizedGdPictureImage(ImageID, 50, 100, Drawing2D.InterpolationMode.Bicubic)
   If ResizedImage <> 0 Then
      oGdPictureImaging.SaveAsPNG(ResizedImage, "output.png")
      oGdPictureImaging.ReleaseGdPictureImage(ResizedImage)
   End If
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Else
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members