CreateGdPictureImageFromHwnd(Int32) Method
Creates a new GdPicture image from a window handle HWnd.
public int CreateGdPictureImageFromHwnd(
int HANDLE
)
public function CreateGdPictureImageFromHwnd(
HANDLE: Integer
): Integer;
public function CreateGdPictureImageFromHwnd(
HANDLE : int
) : int;
public: int CreateGdPictureImageFromHwnd(
int HANDLE
)
public:
int CreateGdPictureImageFromHwnd(
int HANDLE
)
'Declaration
Public Overloads Function CreateGdPictureImageFromHwnd( _
ByVal HANDLE As Integer _
) As Integer
Parameters
- HANDLE
- A Window Handle, as Integer value. This must be a top-level window or a child of
a top level window.
Return Value
0: The image could not be created. 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.
Creating a GdPicture image from a Window handle and saving to a PNG file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromHwnd(gdpictureImaging.GetDesktopHwndI());
gdpictureImaging.SaveAsPNG(imageID, "image.png");
gdpictureImaging.ReleaseGdPictureImage(imageID);
}