Class PaintEventArgs
Provides data for the Paint or other paint events.
public class PaintEventArgs : BaseEventArgs
- Inheritance
-
PaintEventArgs
- Derived
Remarks
A PaintEventArgs specifies the Graphics to use to paint the control or object and the ClipRectangle in which to paint.
Constructors
- PaintEventArgs(Graphics, RectD)
Initializes a new instance of the PaintEventArgs class.
- PaintEventArgs(Graphics, RectD, RectD)
Initializes a new instance of the PaintEventArgs class.
- PaintEventArgs(Func<Graphics>, RectD)
Initializes a new instance of the PaintEventArgs class.
- PaintEventArgs(Func<Graphics>, RectD, RectD)
Initializes a new instance of the PaintEventArgs class.
Properties
- ClientRectangle
Gets or sets the client area of the object, represented as a rectangle.
- ClipRectangle
Gets the rectangle that describes the update/invalidated region that should be repainted. What it means:
- It is in control client coordinates (origin = top-left of the client area).
- It is the bounding rectangle of the update region (the union of invalidated rectangles). The OS may give you the minimal rectangle that covers the dirty region.
- It is expressed in dips (i.e., logical coordinates for the control surface).
- By calls such as Invalidate(), Invalidate(Rectangle), Invalidate(Rectangle, bool) or by the OS when exposed regions change.
- If you call Refresh() or Update() you get a paint for the invalidated area (which may be the whole client if you invalidated the whole control).
- GraphicsAllocated
Gets whether canvas was allocated.
Methods
- WithRect(RectD)
Returns a new PaintEventArgs instance with the specified clipping and client rectangles. If the specified rectangle matches both ClipRectangle and ClientRectangle, the current instance is returned.
- WithRects(RectD, RectD)
Returns a new instance of
PaintEventArgswith the same canvas and the specified rectangles. If the specified rectangles match the current rectangles, the current instance is returned.