예제 #1
0
void CSplashWnd::OnPaint()
{
	CPaintDC dc (this);

	Graphics g (dc.GetSafeHdc ());
	g.DrawImage ((Bitmap*) *m_pBitmap, 0, 0, m_nWidth, m_nHeight);
}
예제 #2
0
void CTimeEv::PaintVideoFrame(CPaintDC& dc)
{
	if(!m_hdd)
		return;

	m_videoRect = m_MainRect;
	
	m_videoRect.left += 11 + 550;
	m_videoRect.bottom -= 4; //45
	m_videoRect.top = m_videoRect.bottom - 206;
	m_videoRect.right = m_videoRect.left + 275;

	m_videoRect.left += 1;
	m_videoRect.top += 1;
	m_videoRect.right -= 1;
	m_videoRect.bottom -= 1;

	bool bChangeSz = false;

	if(m_videoRect.Width() != m_iFrameW)
	{
		m_iFrameW = m_videoRect.Width();
		bChangeSz = true;
	}
	
	if(m_videoRect.Height() != m_iFrameH)
	{
		m_iFrameH = m_videoRect.Height();
		bChangeSz = true;
	}

	if(bChangeSz || !m_pDIBFrame)
	{
		if(m_pDIBFrame) delete [] m_pDIBFrame;
		makeRgbDIB(m_pDIBFrame,m_iFrameW,m_iFrameH,0,0);
	}
		
	LPBITMAPINFOHEADER pBMP = m_oAVIR.GetCurrentFrame();

//	SaveBMP(pBMP,"orig_frame.bmp");

	if(!pBMP)
	{	Write2Log("Couldn't extract frame %d",m_oAVIR.CurrentFrame());
		return;
	}

	BITMAPINFOHEADER* pbmpnew = (BITMAPINFOHEADER*)m_pDIBFrame;

	StretchDIB(pbmpnew,(byte*)pbmpnew+sizeof(BITMAPINFOHEADER),0,0,pbmpnew->biWidth,pbmpnew->biHeight,
		pBMP,(byte*)pBMP+sizeof(BITMAPINFOHEADER),0,0,pBMP->biWidth,pBMP->biHeight);

	//byte* pdata=(byte*)pBMP+pBMP->biSize+pBMP->biClrUsed*sizeof(RGBQUAD);
	byte* pdata = (byte*)pbmpnew+sizeof(BITMAPINFOHEADER);

//	SaveBMP(pbmpnew,"new_frame.bmp");

	// Convert Data To Requested Bitmap Format & Draw IT!!!
	DrawDibDraw(m_hdd, dc.GetSafeHdc(), m_videoRect.left, m_videoRect.top, pbmpnew->biWidth, pbmpnew->biHeight, pbmpnew, pdata, 0, 0, pbmpnew->biWidth, pbmpnew->biHeight, 0);
}