TMlSkinImageSlider

An image slider that pages through several pictures, optionally on its own — the usual choice for a banner or a photo strip.

Category
Image lists
Unit
uMlSkinImageSlider.pas
Inherits from
TMlSkinCustomImageSliderTMlSkinCustomPanelTMlSkinCustomControl

Notes

  • AutoSlider starts automatic paging, SliderInterval is how long each image stays and SliderSpeed how fast it slides.
  • SliderType picks the transition, and AutoImageSize fits the images to the control.
  • ButtonLeft and ButtonRight supply the paging button images, each with its own click event.
  • Moving to another image fires OnSliderPageChanged, and the dots at the bottom fire OnDotButtonClick.

Example

From the demo MlSkin.Demo.图片轮播滑动显示.v4.6 (.dfm form file)

object sld1: TMlSkinImageSlider
  Left = 102
  Top = 48
  Width = 632
  Height = 340
  ButtonLeft.Active = True
  ButtonLeft.Image = 'MlSkinSlides'
  ButtonLeft.Normal = 2
  ButtonLeft.Hot = 0
  ButtonLeft.Disable = 0
  ButtonLeft.Count = 4
  ButtonLeft.Pressed = 2
  ButtonRight.Active = True
  ButtonRight.Image = 'MlSkinSlides'
  ButtonRight.Normal = 3
  ButtonRight.Hot = 1
  ButtonRight.Disable = 0
  ButtonRight.Count = 4
  ButtonRight.Pressed = 2
  Images = <

Properties 15

NameTypeDefaultDescription
AutoImageSizeBooleanTrueScales the images to the control size automatically.
AutoSliderBooleanTruePages to the next image automatically.
ButtonLeftTPngPicturesImage for the previous-image button.
ButtonRightTPngPicturesImage for the next-image button.
ImagesTMlSkinSliderItemCollectionThe ImageList the icons come from.
SliderIntervalInteger3000How long each image stays, in milliseconds.
SliderSpeedInteger50How fast the slide transition runs.
SliderTypeTSliderTypestLeftRightTransition style: sliding, fading and so on.
OptionsTImageSliderOptions[soLeftRightButtonVisible, soDotButtonVisible]A group of options for this control; expand it to set them individually.
AlphaByte192Opacity: 0 fully transparent, 255 opaque.
BorderAlphaByte255Border opacity from 0 (invisible) to 255 (solid).
BorderSidesTSidesWhich border edges are drawn — any combination of top, bottom, left and right.
BorderColorTColor$00D9CBBABorder color.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.
DoubleBorderBooleanTrueDouble border: draws a second line inside the border.

Events 5

NameTypeDefaultDescription
OnLeftButtonClickTNotifyEventFires when the previous-image button is clicked.
OnRightButtonClickTNotifyEventFires when the next-image button is clicked.
OnDotButtonClickTNotifyEventFires when one of the dot indicators at the bottom is clicked.
OnItemClickTItemClickEventFires when an item is clicked.
OnSliderPageChangedTNotifyEventFires after the slider moves to another image.
Events of TMlSkinCustomPanel 1
NameTypeDefaultDescription
OnCustomDrawTMlCustomDrawEventCustom draw event: paint your own content after the control has drawn itself.
Properties of TMlSkinCustomControl 4
NameTypeDefaultDescription
AboutTMlAboutInfoA 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
OnDPIChangedTMlDPIChangedEventFires 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.
OnBackgroundChangingTMlBackgroundEventFires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEventFires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEventFires 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.