PixtureBox的Timer事件

jianghaigang806 2010-01-13 11:20:52
PixtureBox的Timer事件
怎样实现图片的轮换!
...全文
109 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
jianghaigang806 2010-01-14
  • 打赏
  • 举报
回复
[color=#FF0000]谢谢大家!!![/color]我今天用imagelist和picturebox实现了,但是显示的图片太小,都是ico格式的,高怎末修改啊!!!因为存到imagelist里的图片变小了!!!!
kensouterry 2010-01-13
  • 打赏
  • 举报
回复
1楼的方法不错,顶了
liushengmz 2010-01-13
  • 打赏
  • 举报
回复
樓上那麽多的方法,樓主總有一個受用的吧? 
zhao38322684 2010-01-13
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 lianshaohua 的回复:]
把图片(或名字)读到内存,放到List <T>中,然后添加一timer,设置好间隔时间,定时的去加载相应的图片就行了。。。
[/Quote] 顶
mxc1225 2010-01-13
  • 打赏
  • 举报
回复
Timer控件有事件!!在事件里操作
int ico = 1;
private void timer1_Tick(object sender, EventArgs e)
{
string path; //把图标设置成数字名,获取图标保存路径
path = "d:\\" + ico.ToString() + ".ico";
//实例图标对象赋值给控件的Icon属性
this.notifyIcon1.Icon = new Icon(path);
ico++;//变换图标序号
if (ico > 2)
{
ico = 1; //还原图标序号
}
}

我这只有两张图片!!
ckl881003 2010-01-13
  • 打赏
  • 举报
回复
把图片的路径读到数组里
string[] imgUrl = new string[];
然后定时读数组,把新的地址让picturebox显示就行了
ztenv 2010-01-13
  • 打赏
  • 举报
回复
把图片(或名字)读到内存,放到List<T>中,然后添加一timer,设置好间隔时间,定时的去加载相应的图片就行了。。。
tianliang1 2010-01-13
  • 打赏
  • 举报
回复
修改哈,没有timer.start()函数,这只是一点思路,方法笨,单能看懂最重要
    public partial class Form1 : Form
{
string[] temp = new string [3];//假如你存三张图片
int i = 0;
public Form1()
{
InitializeComponent();

temp[0] = @"F:\图片库\生活留恋\新华公园\P1020090.jpg";//这里要有扩展名
temp[1] = @"F:\图片库\生活留恋\新华公园\P1020091.jpg";
temp[2] = @"F:\图片库\生活留恋\新华公园\P1020092.jpg";
this.timer1.Start();//这里开始Timer,还有就是你的那个时间间隔设置稍微长点(2000),不然你看不懂图案的转变
}

private void timer1_Tick(object sender, EventArgs e)
{
if (i < 3)
{
this.pictureBox1.Image = Image.FromFile(temp[i]);
i++;
}
}
}
tianliang1 2010-01-13
  • 打赏
  • 举报
回复
不会就看看简单的
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
using System.Data .SqlClient ;

namespace WindowsFormsApplication1
{

public partial class Form1 : Form
{
string[] temp = new string [3];//假如你存三张图片
int i = 0;
public Form1()
{
InitializeComponent();
temp[0] = "放图片1的路径";
temp[1] = "放图片2的路径";
temp[2] = "放图片3的路径";
}

private void timer1_Tick(object sender, EventArgs e)
{
if (i < 3)
{
this.pictureBox1.Image = Image.FromFile(temp[i]);
i++;
}
lishanquan 2010-01-13
  • 打赏
  • 举报
回复
1楼的方法我不会????
erydemimi 2010-01-13
  • 打赏
  • 举报
回复
楼上的都可以实现

111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧