我想用 C# 制作一个图像查看器Visual Studio 2010 http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2010几秒钟后一张一张地显示图像:
i = 0;
if (image1.Length > 0) //image1 is an array string containing the images directory
{
while (i < image1.Length)
{
pictureBox1.Image = System.Drawing.Image.FromFile(image1[i]);
i++;
System.Threading.Thread.Sleep(2000);
}
当程序启动时,它会停止并只显示第一张和最后一张图像。
Thread.Sleep 会阻止您的 UI 线程使用系统.Windows.Forms.定时器 http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx反而。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)