本文整理汇总了C++中FramePtr::GetImageSize方法的典型用法代码示例。如果您正苦于以下问题:C++ FramePtr::GetImageSize方法的具体用法?C++ FramePtr::GetImageSize怎么用?C++ FramePtr::GetImageSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FramePtr
的用法示例。
在下文中一共展示了FramePtr::GetImageSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnFrameReady
//
// This event handler is triggered through a MFC message posted by the frame observer
//
// Parameters:
// [in] status The frame receive status (complete, incomplete, ...)
// [in] lParam [Unused, demanded by MFC signature]
//
// Returns:
// Nothing, always returns 0
//
LRESULT CAsynchronousGrabDlg::OnFrameReady( WPARAM status, LPARAM lParam )
{
if( true == m_bIsStreaming )
{
// Pick up frame
FramePtr pFrame = m_ApiController.GetFrame();
if( SP_ISNULL( pFrame) )
{
Log( _TEXT("frame ptr is NULL, late call") );
return 0;
}
// See if it is not corrupt
if( VmbFrameStatusComplete == status )
{
VmbUchar_t *pBuffer;
VmbUchar_t *pColorBuffer = NULL;
VmbErrorType err = pFrame->GetImage( pBuffer );
if( VmbErrorSuccess == err )
{
VmbUint32_t nSize;
err = pFrame->GetImageSize( nSize );
if( VmbErrorSuccess == err )
{
VmbPixelFormatType ePixelFormat = m_ApiController.GetPixelFormat();
CopyToImage( pBuffer,ePixelFormat, m_Image );
// Display it
RECT rect;
m_PictureBoxStream.GetWindowRect( &rect );
ScreenToClient( &rect );
InvalidateRect( &rect, false );
}
}
}
else
{
// If we receive an incomplete image we do nothing but logging
Log( _TEXT( "Failure in receiving image" ), VmbErrorOther );
}
// And queue it to continue streaming
m_ApiController.QueueFrame( pFrame );
}
return 0;
}