本文介绍了图片框中的图像切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
好吧我的问题可能有点模糊。假设我有两个图像i-e图像1和图像2,我希望它们在同一个图片框中一个接一个地显示在图片框1中。现在,一种可能不是一种聪明方式的方法是
Hello
OK my question might be a bit vague. Say i have two images i-e "image 1" and "image 2" and i want both of them to be displayed one after the other one in the same picturebox say picturebox1. Now one way that might not be a smart way of doing it is
while(true)
{
picturebox1.image=image 1;
picturebox1.refresh();
pictureboz1.image=image 2;
picturebox1.refresh();
}
还有其他办法吗?
无论如何谢谢
Is there any other way of doing it.?
Thanks anyways
推荐答案
pictureBox1.Image = showFirst ? image1 : image2;
showFirst = !showFirst;
这应该每秒更改一次图像。
That should change your image every second.
这篇关于图片框中的图像切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!