GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / CreateNewGdPictureImage Method / CreateNewGdPictureImage(Int32,Int32,GdPicturePixelFormat,GdPictureColor) Method
The width, in pixels, of the newly created image.
The height, in pixels, of the newly created image.
A member of the PixelFormat enumeration. The required pixel format of the newly created image.
A color object that defines the background color of the newly created image. This parameter is ignored for indexed bitmap. You can obtain a suitable color using the one of the ARGB() overloads.





In This Topic
CreateNewGdPictureImage(Int32,Int32,GdPicturePixelFormat,GdPictureColor) Method
In This Topic
Creates a new empty GdPicture image with specific dimensions, bit depth (bits per pixel), and a background color. The newly created image is identified by its unique non-zero image identifier.

Please note that it is your responsibility to release the image resources once you have no use for them.

Syntax
'Declaration
 
Public Overloads Function CreateNewGdPictureImage( _
   ByVal Width As Integer, _
   ByVal Height As Integer, _
   ByVal PixelFormat As GdPicturePixelFormat, _
   ByVal BackColor As GdPictureColor _
) As Integer
public int CreateNewGdPictureImage( 
   int Width,
   int Height,
   GdPicturePixelFormat PixelFormat,
   GdPictureColor BackColor
)
public function CreateNewGdPictureImage( 
    Width: Integer;
    Height: Integer;
    PixelFormat: GdPicturePixelFormat;
    BackColor: GdPictureColor
): Integer; 
public function CreateNewGdPictureImage( 
   Width : int,
   Height : int,
   PixelFormat : GdPicturePixelFormat,
   BackColor : GdPictureColor
) : int;
public: int CreateNewGdPictureImage( 
   int Width,
   int Height,
   GdPicturePixelFormat PixelFormat,
   GdPictureColor BackColor
) 
public:
int CreateNewGdPictureImage( 
   int Width,
   int Height,
   GdPicturePixelFormat PixelFormat,
   GdPictureColor BackColor
) 

Parameters

Width
The width, in pixels, of the newly created image.
Height
The height, in pixels, of the newly created image.
PixelFormat
A member of the PixelFormat enumeration. The required pixel format of the newly created image.
BackColor
A color object that defines the background color of the newly created image. This parameter is ignored for indexed bitmap. You can obtain a suitable color using the one of the ARGB() overloads.

Return Value

A unique image identifier of the GdPicture image representing the newly created image. The returned value is non-zero if the image is successfully created. Please first of all use the GdPictureImaging.GetStat method to determine if this method has been successful.

Be aware that you need to release the image resource with the GdPictureImaging.ReleaseGdPictureImage method after being used.

Remarks
It is recommend to use the GdPictureImaging.GetStat method to identify the specific reason for the method's failure, if any.
See Also