| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2657 人关注过本帖
标题:实时图像显示在对话框中的问题
只看楼主 加入收藏
kongxiangfei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-11-18
结帖率:0
收藏
 问题点数:0 回复次数:10 
实时图像显示在对话框中的问题
  我现在有一个1394接口的摄像头,一个电脑,基于VS2008的Visual C#的窗体应用程序。现在要把摄像头实时采集的图像显示在对话框中picturebox控件中。图像已能采集,保存在flycaptureimge(自定义的结构体) image(结构体变量)中。现在我不知道用C#语言怎么把采集的实时图像显示到picturebox控件中。请给我C#大侠能给点建议,最好给点实例代码。先谢谢大家。
搜索更多相关主题的帖子: 应用程序 摄像头 对话框 结构体 
2011-04-21 11:15
athenalux
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:河北石家庄
等 级:小飞侠
威 望:8
帖 子:975
专家分:2514
注 册:2008-11-26
收藏
得分:0 
都有图相了,直接显示就行了呗

QQ:81704464
2011-04-21 12:18
kongxiangfei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-11-18
收藏
得分:0 
回复 2楼 athenalux
我就是不知到在C#中怎么直接显示?显示用什么函数?
2011-04-21 17:38
xydddaxia
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:33
帖 子:466
专家分:2307
注 册:2009-3-20
收藏
得分:0 
如果有image类型了直接 this.pictureBox1.Image = 结构体.image

站在春哥的肩膀上
2011-04-21 17:55
kongxiangfei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-11-18
收藏
得分:0 
回复 4楼 xydddaxia
好,我试试。
2011-04-21 18:38
kongxiangfei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-11-18
收藏
得分:0 
回复 4楼 xydddaxia
现在的问题我用了你给的语句,可是编译器总提示错误 CS0029: 无法将类型“FlyCaptureImage”隐式转换为“System.Drawing.Image”,保存在结构体变量的图像给事和要求的位图格式不一样啊,有什么办法解决吗?
2011-04-22 21:55
a101069
Rank: 2
等 级:论坛游民
帖 子:18
专家分:64
注 册:2011-4-10
收藏
得分:0 
强制转换试试?
2011-04-26 19:01
athenalux
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:河北石家庄
等 级:小飞侠
威 望:8
帖 子:975
专家分:2514
注 册:2008-11-26
收藏
得分:0 
flycaptureimge(自定义的结构体) image(结构体变量)如何定义的?

QQ:81704464
2011-04-27 10:29
kongxiangfei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-11-18
收藏
得分:0 
回复 8楼 athenalux
typedef struct FlyCaptureImage
{
   // Rows, in pixels, of the image.
   int iRows;
   // Columns, in pixels, of the image.
   int iCols;
   // Row increment.  The number of bytes per row.
   int iRowInc;
   // Video mode that this image was captured with.  This member is only
   // populated when the image is returned from a grab call.
   FlyCaptureVideoMode videoMode;
   // Timestamp of this image.
   FlyCaptureTimestamp timeStamp;
   // Pointer to the actual image data.
   unsigned char* pData;
   //
   // If the returned image is Y8, Y16, RAW8 or RAW16, this flag indicates
   // whether it is a greyscale or stippled (bayer tiled) image.  In all
   // other modes, this flag has no meaning.
   //
   bool bStippled;
   // The pixel format of this image.
   FlyCapturePixelFormat pixelFormat;

   // This field is always 1 for single lens cameras.  This field is
   // used to indicate the number of images contained in the structure
   // when dealing with multi-imager systems such as the Bumblebee2
   // or XB3?
   int iNumImages;

   // Reserved for future use.
   unsigned long  ulReserved[ 5 ];

} FlyCaptureImage;
2011-05-03 17:20
kongxiangfei
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2010-11-18
收藏
得分:0 
回复 8楼 athenalux
就是上边那样定义的,和windoows自定义的不一样,我在C++中用stretchdibits可以将图像显示到对话框中的picturecontrol中。但是在C#环境中怎么办呢?
2011-05-03 17:23
快速回复:实时图像显示在对话框中的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033134 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved