关于AVI文件插入文字

skly22222 2006-12-07 11:48:04
我用自己的数据流通过AVIStreamWrite()生成一个AVI文件,但是现在我想另外在AVI里面放入文字。一个做法就是把文字转换成二进制位图插入到数据流中,但是这种做法太麻烦。另一种是
_fmemset(&strhdr, 0, sizeof(strhdr));
strhdr.fccType = streamtypeText;// text type
strhdr.fccHandler = 0;
strhdr.dwScale = 1;
strhdr.dwRate = 15; // 15 fps
strhdr.dwSuggestedBufferSize = alpbi->biSizeImage;
SetRect(&strhdr.rcFrame, 0, 0,
(int) biWidth,
(int) biHeight);
// And create the stream;
hr = AVIFileCreateStream(pfile,&psText,&strhdr);
DWORD dom;
dom=sizeof(dom);
AVIStreamSetFormat(psText, 0,dom,sizeof(dom));

strcpy(szMessage, "This is frame #%d");

int iLen = wsprintf(szText, szMessage, (int)(nFrames + 1));
AVIStreamWrite(psText,
nFrames ,
1,
szText,
iLen + 1,
AVIIF_KEYFRAME,
NULL,
NULL);
我用streamtypeText类型想往一帧里面写入字符。但是程序运行后AVI里面没有出现字符。我认为是AVIStreamSetFormat()没弄好。请问那位作过这个,请多多指教。
...全文
126 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
84shelley 2006-12-13
  • 打赏
  • 举报
回复
mark
vcnewer 2006-12-07
  • 打赏
  • 举报
回复
帮顶

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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