Description
This structure holds data passed to event handlers for drawing-related events:
#PG_Event_Draw
and #PG_Event_DrawForeground. It provides information about the drawing area's dimensions
and
DPI scaling.
Structure Definition
Structure PG_EventDraw
id.i ; Reserved or event-specific identifier (often 0 for draw events)
width.d ; Width of the drawing area in Device Independent Pixels (DIPs)
height.d ; Height of the drawing area in Device Independent Pixels (DIPs)
widthPixels.i ; Width of the drawing area in physical pixels
heightPixels.i ; Height of the drawing area in physical pixels
dpiScaleX.d ; Horizontal DPI scaling factor (Current DPI / 96.0)
dpiScaleY.d ; Vertical DPI scaling factor (Current DPI / 96.0)
state.i ; Reserved or state information (often 0 for draw events)
EndStructure
Members
id.i
Typically not used or set to 0 for standard draw events. Might be used by
specific widgets or custom events.
width.d
The logical width of the object (Window or Widget) being drawn, expressed
in DIPs. Use this width for most ProGUI drawing and layout calculations.
height.d
The logical height of the object (Window or Widget) being drawn,
expressed in DIPs. Use this height for most ProGUI drawing and layout calculations.
widthPixels.i
The actual width of the object's drawing surface in physical
pixels.
Useful for calculations involving direct pixel manipulation or OS-level functions.
heightPixels.i
The actual height of the object's drawing surface in physical
pixels.
dpiScaleX.d
The scaling factor applied horizontally due to system DPI settings.
Multiply DIP values by this factor to get pixel values (approximately; use `widthPixels` for exact
value).
dpiScaleY.d
The scaling factor applied vertically due to system DPI settings.
Multiply DIP values by this factor to get pixel values (approximately; use `heightPixels` for exact
value).
state.i
Typically not used or set to 0 for standard draw events.
Used By Events
#PG_Event_Draw#PG_Event_DrawForeground
Remarks
When handling draw events, use the `width.d` and `height.d` members for drawing commands within ProGUI, as these account for DPI scaling automatically. The `widthPixels` and `heightPixels` are provided for scenarios requiring exact pixel dimensions.
See Also
AddEventHandler, Event Handling Overview
Supported OS
Windows, Linux