GpiCreatePS: Difference between revisions
Appearance
Created page with "==Syntax== GpiCreatePS( hab, hdc, psizlSize, flOptions) ==Parameters== ;hab (HAB) - input: ;hdc (HDC) - input: ;psizlSize (PSIZEL) - input: ;flOptions (ULONG): ==Return..." |
No edit summary |
||
Line 1: | Line 1: | ||
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== | ==Syntax== | ||
GpiCreatePS( hab, hdc, psizlSize, flOptions) | GpiCreatePS( hab, hdc, psizlSize, flOptions) | ||
Line 4: | Line 6: | ||
==Parameters== | ==Parameters== | ||
;hab (HAB) - input: | ;hab (HAB) - input: | ||
;hdc (HDC) - input: | :A handle to an anchor block (AB) that identifies the process that is creating the PS. | ||
;psizlSize (P[[SIZEL]]) - input: | ;hdc (HDC) - input | ||
:A handle to a device context (DC) that specifies the device that the PS will be associated with. | |||
;psizlSize (P[[SIZEL]]) - input | |||
: A PSIZEL structure that specifies the size and resolution of the PS. | |||
;flOptions (ULONG): | ;flOptions (ULONG): | ||
:A set of flags that specify options for creating the PS. | |||
==Returns== | ==Returns== | ||
;rc (HPS) | ;rc (HPS) | ||
The function returns a handle to the created PS, or NULL if an error occurs. | |||
==Sample== | |||
<pre> | |||
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 | |||
} | |||
</pre> | |||
[[Category:Gpi]] | [[Category:Gpi]] |
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)
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 }