TMlSkinCircleShape

A circular shape that can show an image inside the circle — the usual way to build round avatars.

Category
Align & shapes
Unit
uMlSkinCircleShape.pas
Inherits from
TMlSkinCustomPanel → TMlSkinCustomControl

Notes

  • Picture is the image to display; anything outside the circle is clipped away.
  • Color fills the circle and is what shows when no image is set.

Example

From the demo MlSkin.Demo.工具栏和菜单栏.v3.0 (.dfm form file)

object mlskncrclshp1: TMlSkinCircleShape
  Left = 32
  Top = 0
  Width = 120
  Height = 120
  Color = clWhite
  Picture = '.\logo.png'
  Alpha = 0
  BorderSides = []
end

Properties 9

NameTypeDefaultDescription
PictureTMlResID—The image used by the control, given as a resource ID or an image file path.
ColorTColor—Background color of the control; ignored while Transparent is on.
AlphaByte192Opacity: 0 fully transparent, 255 opaque.
BorderSidesTSides—Which border edges are drawn — any combination of top, bottom, left and right.
BorderColorTColor$00D9CBBABorder color.
BackgroundImageTMlResID—Background image, given as a resource ID or an image file path.
BackgroundOffsetXInteger0Horizontal offset of the background image in pixels.
BackgroundOffsetYInteger0Vertical offset of the background image in pixels.
DoubleBorderBooleanTrueDouble border: draws a second line inside the border.
Events of TMlSkinCustomPanel 1
NameTypeDefaultDescription
OnCustomDrawTMlCustomDrawEvent—Custom draw event: paint your own content after the control has drawn itself.
Properties of TMlSkinCustomControl 4
NameTypeDefaultDescription
AboutTMlAboutInfo—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.
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
OnDPIChangedTMlDPIChangedEvent—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.
OnBackgroundChangingTMlBackgroundEvent—Fires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEvent—Fires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEvent—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.