现有一个EVENT:OnNewImage();
作用为:Event generated every time a new image/frame is received
一个Methods:HRESULT GetCurrentImage(int theFormat,
VARIANT* theBuffer,
LONG* theBufferSize
);
作用为:Gets the data corresponding to the image currently being displayed。
其中:theFormat :Identifier specifiying the format of the image data. Values available are: 0 = JPEG, 1 = BMP
theBuffer :The buffer where the image data is returned.
theBufferSize: Size of the image data buffer returned.
现在OnNewImage()里使用GetCurrentImage,想将theBuffer里面的图片数据一张一张放入一个文件,读取的时候再想办法通过文件里存储的图片数据及图片大小数据,将图片连续显示出来。
CTest::OnNewImage()
{
int format;
VARIANT Buffer[100];
long Size[10];
//?这里我不知道该给Buffer和Size怎样定义,好象只能定义成数组?那么该定义成多大的?
m_Media.GetCurrentImage(format,Buffer,Size);
//后面应该是怎样把得到的Buffer数据存入文件,但这么存只存了一张图片,下一张图片来的时候怎么能也存到file里呢?
CFlie file;
file.Open("D:\\axis.jpeg",CFile::modeWrite | CFile::modeCreate));
file.Write(Buffer,??);
file.Close;
}
CTest::Play()
{
//这里又怎样将文件里的图片一张张解出来并连续播放成视频?
}
作用为:Event generated every time a new image/frame is received
一个Methods:HRESULT GetCurrentImage(int theFormat,
VARIANT* theBuffer,
LONG* theBufferSize
);
作用为:Gets the data corresponding to the image currently being displayed。
其中:theFormat :Identifier specifiying the format of the image data. Values available are: 0 = JPEG, 1 = BMP
theBuffer :The buffer where the image data is returned.
theBufferSize: Size of the image data buffer returned.
现在OnNewImage()里使用GetCurrentImage,想将theBuffer里面的图片数据一张一张放入一个文件,读取的时候再想办法通过文件里存储的图片数据及图片大小数据,将图片连续显示出来。
CTest::OnNewImage()
{
int format;
VARIANT Buffer[100];
long Size[10];
//?这里我不知道该给Buffer和Size怎样定义,好象只能定义成数组?那么该定义成多大的?
m_Media.GetCurrentImage(format,Buffer,Size);
//后面应该是怎样把得到的Buffer数据存入文件,但这么存只存了一张图片,下一张图片来的时候怎么能也存到file里呢?
CFlie file;
file.Open("D:\\axis.jpeg",CFile::modeWrite | CFile::modeCreate));
file.Write(Buffer,??);
file.Close;
}
CTest::Play()
{
//这里又怎样将文件里的图片一张张解出来并连续播放成视频?
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货