PeachDrawing.Core
PeachDrawing.Core
Brush Class
A fill or stroke paint source - a closed set of plain-data shapes (a solid colour and three
gradient kinds) any Canvas backend can interpret without knowing which
other backend built the instance. This is the same discriminated-union shape CssImage
(Html/Core/Entities/CssImage.cs) already uses for background/gradient/list-marker images -
see CssImagePainter.Paint’s type-dispatch for the precedent. A concrete Canvas
(GraphicsAdapter, RasterCanvas) pattern-matches on the concrete subtype to build
whatever native paint representation it needs; nothing here names a PDF- or raster-specific type.
public abstract class Brush : System.IDisposable
Inheritance System.Object → Brush
Derived
↳ ConicGradientBrush
↳ HatchBrush
↳ LinearGradientBrush
↳ RadialGradientBrush
↳ SolidBrush
↳ TileBrush
Implements System.IDisposable
Remarks
Brushes used to be opaque, backend-owned handles (a zero-member marker plus a same-assembly downcast to read real data out of them) - workable only because exactly one concrete backend family existed. Making every subtype real, public data instead is what lets a second backend (the raster backend) - or, eventually, a third party’s own Canvas - read a brush without reaching into another backend’s internals.
| Methods | |
|---|---|
| Dispose() | No native resource is owned by any of these plain-data shapes; kept for source compatibility with existing using var brush = ... call sites. |