我想创建一个简单的图像幻灯片,当定时器切换时,它将切换到图片框的下一个索引(并将循环)但具有淡入淡出效果。如何在 C# 中完成?
当前代码不切换图像?还有 - 我怎样才能创建淡入淡出效果?
我创建了一个间隔为 5,000 毫秒的简单计时器,并在启动时启用它。
private void timerImage_Tick(object sender, EventArgs e)
{
if (pictureBox1.Image.Equals(InnovationX.Properties.Resources._1))
{
pictureBox1.Image = InnovationX.Properties.Resources._2;
}
else if (pictureBox1.Image.Equals(InnovationX.Properties.Resources._2))
{
pictureBox1.Image = InnovationX.Properties.Resources._3;
}
else
{
pictureBox1.Image = InnovationX.Properties.Resources._1;
}
}