public struct SlabF
Represents a slab-like box with rounded corners.

Constructors

SlabF

#
public SlabF(RectangleF bounds, float thickness, CornerRadii corners)
Create a slab with differing corner radii.
bounds (RectangleF)
thickness (float)
corners (CornerRadii)

SlabF

#
public SlabF(RectangleF bounds)
Create a slab which looks like a rectangle.
bounds (RectangleF)

Properties

Apex

#
public RectangleF Apex { get; }
Gets the bounds of the slab top face.

ApexPath

#
public GraphicsPath ApexPath { get; }
Gets the graphics path describing the silhouette of the top face. This path is created anew on each call and it is the responsibility of the caller to dispose of it.

Bounds

#
public RectangleF Bounds { get; }
Gets the outer bounds of the slab.

Corners

#
public CornerRadii Corners { get; }
Gets the corner radii values.

EdgePath

#
public GraphicsPath EdgePath { get; }
Gets the graphics path describing the edge between the front and side faces. This path is created anew on each call and it is the responsibility of the caller to dispose of it.

FormPath

#
public GraphicsPath FormPath { get; }
Gets the graphics path describing the silhouette of the entire slab. This path is created anew on each call and it is the responsibility of the caller to dispose of it.

Side

#
public RectangleF Side { get; }
Gets the bounds of the slab side (or front) face, minus the portion which curbes upwards along the edges.

SidePath

#
public GraphicsPath SidePath { get; }
Gets the graphics path describing the silhouette of the side face. Note that the top edge of the side face is straight without any rounded corners and must thus be drawn *before* the front face. This path is created anew on each call and it is the responsibility of the caller to dispose of it.

SidePathExact

#
public GraphicsPath SidePathExact { get; }
Gets the graphics path describing the silhouette of the side face.

Thickness

#
public float Thickness { get; }
Gets the thickness of the slab.

Methods

ArcAt

#
public ArcF ArcAt(SlabArc arc)
Gets the arc at the specified corner. Arcs are always defined in a clockwise fashion.
arc (SlabArc)

Contains

#
public bool Contains(PointF point)
sTest whether a point is on the interior of this slab.
point (PointF)Point.
True if point is on interior.

Depress

#
public SlabF Depress(float factor)
Depress this slab with a normalised factor.
factor (float)Depression factor. Zero = as is, One = fully depressed until the thickness is zero.

MessageBar

#
public bool MessageBar(float height, out GraphicsPath path, out RectangleF bounds)
Create the path for a fixed-height bar running along the top of the slab.
height (float)Height of bar.
path (out GraphicsPath)Path output.
bounds (out RectangleF)Bounds of path.
Success or failure.

Move

#
public SlabF Move(float dx, float dy)
Move this slab to a different location.
dx (float)Horizontal offset.
dy (float)Vertical offset.

MoveTo

#
public SlabF MoveTo(PointF anchor)
Move this slab to a specific location.
anchor (PointF)Location of upper left bounds corner.

PointOnLeftEdge

#
public PointF PointOnLeftEdge(float parameter)
Gets the point along the left edge of the top face.
parameter (float)Normalised parameter (0=top, 1=bottom).

PointOnRightEdge

#
public PointF PointOnRightEdge(float parameter)
Gets the point along the right edge of the top face.
parameter (float)Normalised parameter (0=top, 1=bottom).

VertexAt

#
public PointF VertexAt(SlabVertex vertex)
Gets the coordinates of the specified vertex.
vertex (SlabVertex)Vertex to retrieve.
Coordinates of vertex.

WithCorners

#
public SlabF WithCorners(CornerRadii corners)
Modify the corners of this slab.
corners (CornerRadii)