AntdUI.Image3D 用于展示带 3D 翻转/切换动画的图片,适合封面、卡片、相册预览等场景。
import win.ui;
import dotNet.AntdUI;
/*DSG{{*/
var winform = win.form(text="AntdUI Image3D";right=420;bottom=280)
winform.add(host={cls="custom";left=40;top=30;right=360;bottom=220;z=1})
/*}}*/
var img = AntdUI.Image3D(winform.host);
img.Radius = 12;
img.Round = false;
img.ImageFit = AntdUI.TFit.Cover;
img.Vertical = true;
img.Speed = 15;
img.Duration = 600;
img.EnableHover = true;
winform.show();
win.loopMessage();
// newImage 为 System.Drawing.Image 对象时可播放切换动画
// img.RunAnimation(newImage);
Image:当前图片,类型为 System.Drawing.Image。ImageFit:图片填充方式,AntdUI.TFit。Radius、Round:圆角或圆形。Vertical:是否竖向翻转动画。Speed、Duration:动画速度与持续时间。Shadow、ShadowColor、ShadowOpacity:阴影。EnableHover、HoverBack、HoverImageSvg:悬停覆盖层。RunAnimation(image):切换图片并播放动画。System.Drawing.Image.FromFile(path) 加载。