- 5
- 0
- 约8.85万字
- 约 10页
- 2016-12-03 发布于河南
- 举报
VideoCapure类和H263笔记
Displaying the Captured Video Frame
There are various methods and APIs for displaying the captured frame. You can use SetDIBitsToDevice() method to directly display the frame. But this is quite slow as it is based on Graphics Device Interface (GDI) functions. The better method is to use DrawDib API to draw the frame. The DrawDib functions provide high performance image-drawing capabilities for device-independent bitmaps (DIBs). DrawDib functions write directly to video memory, hence provide better performance.
MSDN:The capPreview macro enables or disables preview mode. In preview mode, frames are transferred from the capture hardware to system memory and then displayed in the capture window using GDI functions
BOOL capPreview(
hwnd,
f
);
Here is the brief view of how to use DrawDib API to display frame:
Collapse HYPERLINK file:///E:\\BetterI\\otherproj\\H263pangzai\\netdown\\VideoNet%20-%20CodeProject.mht Copy Code
// Initialize DIB for drawing...
HDRAWDIB hdib=::DrawDibOpen();
// Then call this function will suitable parameters....
::DrawDibBegin(hdib,...);
// Now if you are ready with frame data just
// invoke this function to display the frame
::DrawDibDraw(hdib,...);
// Finally termination...
::DrawDibEnd(hdib);
::DrawDibClose(hdib);
VFWcamerea工程:
使用capCreateCaptureWindow关联一个窗口进行视频显示。
// 设置预览窗口
CWnd *pWnd=AfxGetMainWnd()-GetDlgItem(IDC_VIDEO);
//得到预览窗口指针,为Animate控件
CRect rect;
pWnd-GetWindowRect(rect); // 得到窗口大小
m_hCapWnd=capCreateCaptureWindow(Capture,
WS_CHILD|WS_VISIBLE,
0,0,
rect.Width(),rect.Width(),
pWnd-GetSafeHwnd(),0); // 设置预览窗口
if(!m_hCapWnd)
{
MessageBox(Set preview window failed!);
return FALSE;
}
// 连接摄像头
if(!capDriverConnect(m_hCapWnd,0))
{
MessageBox(Connect to Camera failed!);
return FALSE;
}
//得到驱动器的属性
capDriverGetCaps(m_hCapWnd,sizeof(CAPDRIVERCAPS), m_CapDrvCap);
if(m_CapDrvCap.fCaptureInitialized) // 查看摄像头是否初始化成功
{
capGetStatus(m_hCapWnd, m_CapStatus,sizeof(m_CapStatus));
// 得
您可能关注的文档
- 7-getcha(),输入输出总结,顺序结构程序举例.ppt
- 妇 科 急 腹 .ppt
- 不良反应系统注册填报说明.ppt
- 1.4.1有理数乘法(第一课时).ppt
- 7.6 等价关系划分.ppt
- CEI锁芯383的技术来源--以色列模帝乐锁业.ppt
- 中国电信税务e通业应用解决方案(福建电信).ppt
- H.248协议介.ppt
- 第2单元learing about language.ppt
- 人教新课标选修六nit 4Learning about language.ppt
- 小区绿化施工协议书.docx
- 墙面施工协议书.docx
- 1 古诗二首(课件)--2025-2026学年统编版语文二年级下册.pptx
- (2026春新版)部编版八年级道德与法治下册《3.1《公民基本权利》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《4.3《依法履行义务》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.2《按劳分配为主体、多种分配方式并存》PPT课件.pptx
- (2026春新版)部编版八年级道德与法治下册《6.1《公有制为主体、多种所有制经济共同发展》PPT课件.pptx
- 初三教学管理交流发言稿.docx
- 小学生课外阅读总结.docx
- 餐饮门店夜经济运营的社会责任报告(夜间贡献)撰写流程试题库及答案.doc
最近下载
- DLT5375-2018 火力发电厂可行性研究报告内容深度规定.pdf VIP
- (2026年春新版)人教版八年级生物下册全册教案.doc
- ISO 5173 2009 金属材料焊缝的破坏性试验—弯曲试验(中文版).pdf VIP
- (高清版)DB13(J)∕T 8555-2023 县城特色风貌设计标准.pdf VIP
- 高级政治经济学(蔡继明)6.分工体系与广义价值决定.ppt VIP
- 潍坊亚星新材料有限公司500吨年六氯环三磷腈和500吨年苄索氯铵项目环境影响报告书.pdf VIP
- 最新2026年时事政治题单招及答案(夺冠).docx VIP
- 学校1530安全教育记录(2026年春季期).docx
- [会计理论葛家澍pdf]葛家澍和他的会计时代.docx VIP
- 解读GB 6441-2025《生产安全事故分类与编码》.pptx
原创力文档

文档评论(0)