主界面有一个timer.一个picturebox.一个按钮触发事件.
程序里面实例化了一个imagelist.
还有一个方法
addframer (bitmap b)
{
imagelist1.images.add(b)
}
用于往imagelist中添加帧一个按钮(butten1)的触发内容是
timer1.Interval = 40;
timer1.Enabled = true;
就是让timer1开始工作.timer的内容是
pcbFrame.Image = imageList1.Images[++i];
pcbFrame.Refresh();
就是吧imagelist1中的图片顺序显示在picturebox中addframer 这个方法是始终在工作的.就是吧一个影片中的每个帧都加入到这个控件的imagelist上.
同时也可能在imagelist得到足够多的帧后就触发butten1的事件.这个时候addframer 和timer1应该同时在工作吧?可是为什么每当我触发butten1(手工点按钮)后调试器就停在
pcbFrame.Image = imageList1.Images[++i];
并且提示
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.但是这个也不是绝对的.有时候不知道怎么就会按照程序流程顺利走下去...按照提示是说内存读写保护.可是为什么会引起这个错误呢?
我用的是 vs 2005
程序里面实例化了一个imagelist.
还有一个方法
addframer (bitmap b)
{
imagelist1.images.add(b)
}
用于往imagelist中添加帧一个按钮(butten1)的触发内容是
timer1.Interval = 40;
timer1.Enabled = true;
就是让timer1开始工作.timer的内容是
pcbFrame.Image = imageList1.Images[++i];
pcbFrame.Refresh();
就是吧imagelist1中的图片顺序显示在picturebox中addframer 这个方法是始终在工作的.就是吧一个影片中的每个帧都加入到这个控件的imagelist上.
同时也可能在imagelist得到足够多的帧后就触发butten1的事件.这个时候addframer 和timer1应该同时在工作吧?可是为什么每当我触发butten1(手工点按钮)后调试器就停在
pcbFrame.Image = imageList1.Images[++i];
并且提示
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.但是这个也不是绝对的.有时候不知道怎么就会按照程序流程顺利走下去...按照提示是说内存读写保护.可是为什么会引起这个错误呢?
我用的是 vs 2005
解决方案 »
- C#操作数据集更新到数据库的问题
- c#播放GIF文件问题。
- connectingstrings 属性尚未初始化
- ■■■在线等,如何判断有没有对文件夹的读写权限
- 框架设计高手请进^_^
- 截取时间段
- DataGrid同一模板列中显示多个不同的图片,急救!!!!!!!!!!!可再加分
- 花了三小时,用C#写了个屏幕取词的算法!(有兴趣一起来讨论一下)
- 急!!向数据库里插入记录,,,
- 求教一个关于调用外部动态链接库的问题。
- 在ASP.net中,创建项目时出现Http/1.1 500 Internal server Error错误!如何修改?
- 关于c#和c++cli互操作时候的调试问题(问了多次还是没有人能解决的问题)
试试
pcbFrame.Image = (Image)imageList1.Images[++i].Clone();
using System;
class Test
{
public static void Main()
{
double x;
x = 1.5;
Console.WriteLine(++x);
x = 1.5;
Console.WriteLine(x++);
Console.WriteLine(x);
}
}
输出
2.5
1.5
2.5
我吧整个解决方案打包了.自己写的很少.很容易看.代码简陋.不要见笑.^_^
pc.xsbip.com/a.rar其实我的主要目的就是捕捉摄像头的帧.吧需要的帧都放入一个imagelist中.然后在特定的时间重现这些帧.本来我是用i++的.但是我以为imagelist的下标是从1开始的.所以我改成++i.但是不管怎么样总要出错.
imagelist.images是从0开始的,
错了今天上班看看,家里上网慢