TMlSkinShape
A shape control for circles, ellipses, rectangles and rounded rectangles, and for arbitrary shapes drawn from an SVG path.
Notes
Shapepicks the shape; for rounded rectangles the radius comes fromRoundRadius.- The fill is set in
Brush, while the outline color, style and width are inPen. - For an irregular shape, put the SVG path data into
SvgPath.
Example
From the demo MlSkin.Demo.HtmlLabel&TMlSkinPopupMessage功能演示.v4.x (.dfm form file)
object shp1: TMlSkinShape
Left = 8
Top = 10
Width = 657
Height = 225
Shape = skRoundRect
Brush.Color = 15658734
Brush.Visible = True
Pen.Color = 5664760
Pen.Visible = False
Pen.Style = psSolid
Pen.Width = 2
DoubleBuffered = False
Anchors = [akLeft, akTop, akRight]
DesignSize = (
657
225)
...
Properties 7
| Name | Type | Default | Description |
|---|---|---|---|
Alpha | Byte | 255 | Opacity: 0 fully transparent, 255 opaque. |
Shape | TMlShapeKind | skCircle | The shape to draw: circle, ellipse, rectangle, rounded rectangle, rounded square and so on. |
Brush | TMlBrush | — | Fill settings: the fill color and whether it is painted at all (Visible). |
Pen | TMlPen | — | Outline settings: pen style (solid, dotted, dashed), width and color. |
RoundRadius | Integer | 8 | Corner radius in pixels, used by the rounded shapes. |
SvgPath | string | — | SVG path data: fill it in to draw an arbitrary shape from that path. |
Color | TColor | clWhite | Background color of the control; ignored while Transparent is on. |
Properties of TMlSkinCustomControl 4
| Name | Type | Default | Description |
|---|---|---|---|
About | TMlAboutInfo | — | A design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm. |
Transparent | Boolean | True | Transparent background: the control skips its own fill and shows the form background (image or color) instead. |
AutoInvalidate | Boolean | False | Repaints automatically when the content changes. Turn it on if property changes do not show up. |
EraseBackground | Boolean | False | Whether the background is erased before painting; worth toggling if the control flickers. |
Events of TMlSkinCustomControl 4
| Name | Type | Default | Description |
|---|---|---|---|
OnDPIChanged | TMlDPIChangedEvent | — | Fires when the screen DPI changes, for example when the window moves to a monitor with a different scaling — a good place to re-adjust anything you draw yourself. |
OnBackgroundChanging | TMlBackgroundEvent | — | Fires just before the background changes, giving you a chance to adjust what is drawn. |
OnBackgroundChanged | TMlCustomDrawEvent | — | Fires after the background has been drawn, so you can paint on top of it. |
OnVisibleChanged | TNotifyEvent | — | Fires when the control is shown or hidden. |
Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.
Offline helpA PDF / CHM version is available for offline reading.