ImageSlider 是当鼠标hover时会出现有两个单击导航元素的图像浏览控件。
要显示图像ImageSlider, 添加图像到 ImageSlider.Images collection.
private void MainForm_Load(object sender, EventArgs e)
{
//Populate ImageSlider with images
mySlider.Images.Add(Image.FromFile(@"d:data1.jpg"));
mySlider.Images.Add(Image.FromFile(@"d:data2.jpg"));
mySlider.Images.Add(Image.FromFile(@"d:data3.jpg"));
mySlider.Images.Add(Image.FromFile(@"d:data4.jpg"));
//增加滑动图像间隔 (default is 700 ms) 设置为1200毫秒
mySlider.AnimationTime = 1200;
//Display images at the center of ImageSlider in their original size
mySlider.LayoutMode = DevExpress.Utils.Drawing.ImageLayoutMode.MiddleCenter;
//...
//Slide to the next image
mySlider.SlideNext();
}
mySlider.AllowLooping = true; // 允许循环 即播放到最后一张next为第一张
mySlider.LayoutMode = DevExpress.Utils.Drawing.ImageLayoutMode.ZoomInside;//图像缩放到Slider大小 如果为ZoomOutsize,则图像放大到自然
以下为示例
Image appearance within an ImageSlider can be tuned via the ImageSlider.LayoutMode property. The ImageSlider.CurrentImageproperty specifies the currently displayed image. Image navigation via code is managed by the SliderBase.SlideNext andSliderBase.SlidePrev inherited methods. The SliderBase.AnimationTime property specifies the duration of the image sliding animation.
This control provides built-in touch-input device support.
The ImageSlider supports dynamic image upload. See the Virtual Mode topic to learn more.
The example demonstrates how to create and customize an ImageSlider control.
| ||||||
复制代码
|
最后
以上就是平淡乐曲最近收集整理的关于图像浏览控件ImageSlider的全部内容,更多相关图像浏览控件ImageSlider内容请搜索靠谱客的其他文章。
发表评论 取消回复