Home > Software engineering >  Video shot, display problems
Video shot, display problems

Time:10-06

Void CMyVideWnd: : RenderFrame (STD: : unique_ptr & lt; ARGBBuffer> Video_frame)
{
Static int frames=0;
Frames++;

if (! Video_frame)
return;
If (image_width_!=video_frame - & gt; Resolution. The width | | image_height_!=video_frame - & gt; Resolution. Height)
{
Image_width_=video_frame - & gt; Resolution. The width;
Image_height_=video_frame - & gt; Resolution. The height;
Image_height_ image_size_=image_width_ * * 4;
Image_. Reset (new uint8_t [image_size_]);
}
//STD: : copy (video_frame - & gt; Buffer, video_frame - & gt; Buffer + image_size_,
//image_. The get ());
Memcpy (image_. The get (), video_frame - & gt; Buffer, image_size_);

//this - & gt; The update ();

//cost * m_pStream;
//IPicture * m_pPictrue;
//OLE_XSIZE_HIMETRIC m_JPGWidth;
//OLE_YSIZE_HIMETRIC m_JPGHeight;


//HGLOBAL hMem=GlobalAlloc (GMEM_MOVEABLE image_size_);
//LPVOID pData=https://bbs.csdn.net/topics/NULL;
//pData=https://bbs.csdn.net/topics/GlobalLock (hMem);
//memcpy (pData, video_frame - & gt; Buffer, image_size_);
//GlobalUnlock (hMem);
//retrieves HRR=CreateStreamOnHGlobal (hMem, TRUE, & amp; M_pStream);
//HRR=OleLoadPicture (m_pStream image_size_, TRUE, IID_IPicture, (LPVOID *) & amp; M_pPictrue);
//m_pPictrue - & gt; Get_Height (& amp; M_JPGHeight);
//m_pPictrue - & gt; Get_Width (& amp; M_JPGWidth);
//CRect lpRec;
//GetDlgItem (IDD_VIDEO_WND) - & gt; GetWindowRect (& amp; LpRec);
//ScreenToClient (& amp; LpRec);
//m_pPictrue - & gt; Render (GetDC () - & gt; M_hDC, lpRec lpRec. Top left,
//, (int) (m_JPGWidth/26.45), (int) (m_JPGHeight/26.45)
//0, m_JPGHeight m_JPGWidth, - m_JPGHeight, NULL);



HGLOBAL HGLOBAL=GlobalAlloc (GMEM_MOVEABLE image_size_);
Void * pData=https://bbs.csdn.net/topics/GlobalLock (hGlobal);
Memcpy (pData, video_frame - & gt; Buffer, image_size_);
GlobalUnlock (hGlobal);
Cost * pStream=NULL;
If (CreateStreamOnHGlobal (hGlobal, TRUE, & amp; PStream)==S_OK)
{
CImage * image=new CImage ();
Image - & gt; Create (image_width_ image_height_, image_size_);
//the Load cost Fail
HRESULT HRESULT=image - & gt; Load (pStream);

//CImage image;
////retrieves the hr=image. The Load (pStream);
//if (SUCCEEDED (image. The Load (TEXT (" 1111 PNG "))))
//{
//image. The Draw (GetDC () - & gt; M_hDC, 0,0,100,500);
//}
PStream - & gt; Release ();
}
GlobalFree (hGlobal);
}
Why I use the image is loading pictures of ordinary load, failure also VS2015 is the use

CodePudding user response:

Video_frame - & gt; Buffer, are you sure this is an image buf? You add a breakpoint img. Load (pStream) after img m_hbitmap if there is a value?
  • Related