首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

佳能摄像机拍照前的的视频预览(EDSDKv2.8),该怎么解决

2012-03-09 
佳能摄像机拍照前的的视频预览(EDSDKv2.8)我用的像机是Eos450D我在它的文档上已经找到了一个代码EdsError

佳能摄像机拍照前的的视频预览(EDSDKv2.8)
我用的像机是Eos450D
我在它的文档上已经找到了一个代码
EdsError startLiveview(EdsCameraRef camera)
{
  EdsError err = EDS_ERR_OK;
  // Get the output device for the live view image
  EdsUInt32 device;
  err = EdsGetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , , sizeof(device), &device );
  // PC live view starts by setting the PC as the output device for the live view image.
  if(err == EDS_ERR_OK)
  {
  device |= kEdsEvfOutputDevice_PC;
  err = EdsSetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , sizeof(device), &device);
  }
  // A property change event notification is issued from the camera if property settings are made successfully.
  // Start downloading of the live view image once the property change notification arrives.
}

EdsError downloadEvfData(EdsCameraRef camera)
{
  EdsError err = EDS_ERR_OK;
  EdsStreamRef stream = NULL;
  EdsEvfImageRef = NULL;
  // Create memory stream.
  err = EdsCreateMemoryStream( 0, &stream);
  // Create EvfImageRef.
  if(err == EDS_ERR_OK)
  {
  err = EdsCreateEvfImageRef(stream, &evfImage);
  }
  // Download live view image data.
  if(err == EDS_ERR_OK)
  {
  err = EdsDownloadEvfImage(camera, evfImage);
  }
  // Get the incidental data of the image.
  if(err == EDS_ERR_OK)
  {
  // Get the zoom ratio
  EdsUInt32 zoom;
  EdsGetPropertyData(erfImage kEdsPropID_Evf_ZoomPosition, 0 , sizeof(zoom), &zoom);
  // Get the focus and zoom border position
  }
  //
  // Display image
  //
  // Release stream
  if(stream != NULL)
  {
  EdsRelease(stream);
  Stream = NULL;
  }
  // Release evfImage
  if(evfImage != NULL)
  {
  EdsRelease(evfImage);
  evfImage = NULL;
  }
}
EdsError endLiveview(EdsCameraRef camera)
{
  EdsError err = EDS_ERR_OK;
  // Get the output device for the live view image
  EdsUInt32 device;
  err = EdsGetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , , sizeof(device), &device );
  // PC live view ends if the PC is disconnected from the live view image output device.
  if(err == EDS_ERR_OK)
  {
  device &= ~kEdsEvfOutputDevice_PC;
  err = EdsSetPropertyData(camera, kEdsPropID_Evf_OutputDevice, 0 , sizeof(device), &device);
  }
}

这里有几个问题,第一是我不知道怎么把这个内容变成vb.net的,还有就是我想这一段也是不完整的,因为我找不到怎么把窗体的内容,就是说这个视频要显示在一个窗体里面,或是一个PictureBox或Panel之类的控件里面,怎么指定这个控件好象也没在上面这段代码上找到,有没有人帮个忙,能给我一段比较完整的代码,最好是我复制进去后就可以运行的,谢谢了。

[解决办法]
这个比较偏门了。

sdk里没有完整的例子吗?
[解决办法]
看看这两段代码能不能帮你

http://www.overridepro.com/2009/06/28/canon-sdk-live-view/

http://stackoverflow.com/questions/895265/live-view-with-canon-edsdk-2-5-2-vb-net
[解决办法]

看看下面的讨论和文章能不能帮你
http://www.overridepro.com/2009/06/28/canon-sdk-live-view/

http://stackoverflow.com/questions/895265/live-view-with-canon-edsdk-2-5-2-vb-net

热点排行