代码

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Threading; namespace picture_0
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} Thread th;
private void Form1_Load(object sender, EventArgs e)
{
th = new Thread
(
delegate ()
{ for (int i = ; i < ; i++)
{ ChangeImage(Image.FromFile(@"picture\18720223738_6b6c58f282_o.jpg"), );
ChangeImage(Image.FromFile(@"picture\amargosa-river-stars.jpg"), ); }
}
);
th.IsBackground = true;
th.Start(); } private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
th.Abort();//结束线程
} private void ChangeImage(Image img, int millisecondsTimeOut)
{
this.Invoke(new Action(() =>
{
pictureBox1.Image = img;
})
);
Thread.Sleep(millisecondsTimeOut); } }
}

代码

  

最新文章

  1. Python之路3【第一篇】Python基础
  2. liunx常用的命令
  3. NetFPGA
  4. Hadoop中JAVA不经过Catch(Exception e)直接到finally或者退出原因
  5. 使用javascript实现在页面打印的效果的三种方式
  6. HIS与CIS的区别与联系
  7. Web开发中的主要概念
  8. SQL SERVER 与ACCESS、EXCEL的数据转换
  9. ARC机制下组合关系
  10. MySQL 日志管理详解
  11. rfid门禁系统笔记
  12. art template前端模板引擎
  13. [转载]10 Best Tools For Websites And Apps Development Ever
  14. PHP 中的超全局变量
  15. XMPP得知--建立一个管理类
  16. for计算100以内的偶数和
  17. 使用Spring MVC构建REST风格WEB应用
  18. C++11 学习 间隔更新中
  19. QScintilla 编译
  20. Java中Jdom解析XML

热门文章

  1. Python基础知识-运算符
  2. [2018-10-29] python开发个人资源共享网--第二天
  3. CSPS_108
  4. linux 打包 | autoconf 使用方法
  5. Havok Physics 2012(2)
  6. 美团店铺数据抓取 token解析与生成
  7. 用PHP+Redis实现延迟任务,实现自动取消订单
  8. nowcoder 鹏
  9. C#实现整型数据字任意编码任意进制的转换和逆转换
  10. 搭建Redis三主三从集群