Jump to content

GpiCreatePS: Difference between revisions

From EDM2
No edit summary
Line 3: Line 3:
==Syntax==
==Syntax==
  GpiCreatePS( hab, hdc, psizlSize, flOptions)
  GpiCreatePS( hab, hdc, psizlSize, flOptions)
or
HPS GpiCreatePS(HAB hab, HDC hdc, PSIZEL psizl, ULONG flOptions)


==Parameters==
==Parameters==

Revision as of 21:34, 7 January 2023

It is used to create a presentation space (PS). A presentation space is a logical container that is used to hold and manage graphical objects, such as lines, curves, text, and images.

Syntax

GpiCreatePS( hab, hdc, psizlSize, flOptions)

or

HPS GpiCreatePS(HAB hab, HDC hdc, PSIZEL psizl, ULONG flOptions)

Parameters

hab (HAB) - input
A handle to an anchor block (AB) that identifies the process that is creating the PS.
hdc (HDC) - input
A handle to a device context (DC) that specifies the device that the PS will be associated with.
psizlSize (PSIZEL) - input
A PSIZEL structure that specifies the size and resolution of the PS.
flOptions (ULONG)
A set of flags that specify options for creating the PS.

Returns

rc (HPS)

The function returns a handle to the created PS, or NULL if an error occurs.

Sample

HAB hab;
HDC hdc;
PSIZEL psizl;
HPS hps;

hab = WinQueryAnchorBlock(HWND_DESKTOP);
hdc = WinOpenWindowDC(HWND_DESKTOP);
psizl.cx = 640;
psizl.cy = 480;

hps = GpiCreatePS(hab, hdc, &psizl, PU_PELS | GPIF_DEFAULT);
if (hps == NULL) {
   // An error occurred, handle it here
}