VisualStyleHelperRenderScaled Method

Renders the visual style element of the specified class, part and state by scaling the actual glyph to the desired size specified in the bounds parameter.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static void RenderScaled(
	string className,
	IntPtr hwnd,
	Graphics graphics,
	int part,
	int state,
	Rectangle bounds
)

Parameters

className  String
The class name of the visual style element.
hwnd  IntPtr
A window handle to use an instance-specific scaling or theme; otherwise, IntPtr.Zero.
graphics  Graphics
A Graphics instance to use as the target of the rendering.
part  Int32
An integer identifier that specifies the part to render.
state  Int32
An integer identifier that specifies the state of the part.
bounds  Rectangle
A Rectangle structure that specifies the bounds of the part to render.

Remarks

If hwnd is not IntPtr.Zero, the rendering can consider instance-specific visual style details, such as dark style or the scaling of a particular control when the application has per-monitor DPI awareness.

For className, part and state you can use the predefined nested classes of the VisualStyleElement class. For more information see also the Parts and States page.

  Note

To render freely scalable visual elements such as push buttons, use always the Render method instead. This method is to scale visual elements of a fix size, such as a checkbox or radio button.

See Also