GdPicture.NET Reference Guide
GetWidth Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : GetWidth Method
GdPicture Image Identifier.
Returns the width of a GdPicture image in pixels.
Syntax
'Declaration
 
Public Function GetWidth( _
   ByVal ImageID As Integer _
) As Integer
public int GetWidth( 
   int ImageID
)
public function GetWidth( 
    ImageID: Integer
): Integer; 
public function GetWidth( 
   ImageID : int
) : int;
public: int GetWidth( 
   int ImageID
) 
public:
int GetWidth( 
   int ImageID
) 

Parameters

ImageID
GdPicture Image Identifier.

Return Value

Width in pixel.
Example
Resizing the image to twice its size.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   Dim Width As Integer = oGdPictureImaging.GetWidth(ImageID)
   Dim Height As Integer = oGdPictureImaging.GetHeight(ImageID)
   oGdPictureImaging.Resize(ImageID, Width * 2, Height * 2, Drawing2D.InterpolationMode.Bicubic)
   oGdPictureImaging.SaveAsPNG(ImageID, "output.png")
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Else
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members