Search

'VISIBLE'에 해당되는 글 2건

  1. 2018.10.22 C# Panel DirectShow Video ScrollBar
  2. 2016.10.24 MFCGridCtrl CGridCtrl ScrollBar Visible

C# Panel DirectShow Video ScrollBar

Programming/C# 2018. 10. 22. 13:40 Posted by TanSanC
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

C# Panel DirectShow Video ScrollBar


        public System.Windows.Forms.Panel pnlVideo;



        public QuartzTypeLib.FilgraphManager m_objFilterGraph = null;

        public QuartzTypeLib.IBasicAudio m_objBasicAudio = null;

        public QuartzTypeLib.IVideoWindow m_objVideoWindow = null;

        public QuartzTypeLib.IMediaEvent m_objMediaEvent = null;

        public QuartzTypeLib.IMediaEventEx m_objMediaEventEx = null;

        public QuartzTypeLib.IMediaPosition m_objMediaPosition = null;

        public QuartzTypeLib.IMediaControl m_objMediaControl = null;





         m_objVideoWindow.SetWindowPosition(pnlVideo.ClientRectangle.Left,

                        pnlVideo.ClientRectangle.Top,

                        pnlVideo.ClientRectangle.Height * (int)videoResolutionRate,

                        pnlVideo.ClientRectangle.Height);



m_objVideoWindow shows the video at original rate



1. ScrollBar Padding 20px



                    m_objVideoWindow.SetWindowPosition(pnlVideo.ClientRectangle.Left,

                        pnlVideo.ClientRectangle.Top,

                        (pnlVideo.ClientRectangle.Height - 20) * (int)videoResolutionRate,

                        pnlVideo.ClientRectangle.Height - 20);


2. Size and Scroll Bar Enable



                pnlVideo.HorizontalScroll.Visible = true;

                pnlVideo.AutoScroll = true;

                pnlVideo.MaximumSize = new Size(this.ClientSize.Width, this.ClientSize.Height - 80);

                pnlVideo.AutoScrollMinSize = new Size((int)UserControl1.videoResolutionRate * (this.ClientSize.Height - 80), this.ClientSize.Height - 80);

                pnlVideo.ClientSize = new Size(this.ClientSize.Width, this.ClientSize.Height - 80);

                pnlVideo.Size = new Size(this.ClientSize.Width, this.ClientSize.Height - 80);




336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

MFCGridCtrl CGridCtrl ScrollBar Visible






If you change Dialog color used by OnEraseBkgnd();



you can't see CGridCtrl's ScrollBar











in that case, you should add m_Grid.SetRedraw(true, true); to OnEraseBkgnd();











BOOL CMyDialog::OnEraseBkgnd(CDC* pDC)
{
	// TODO: 여기에 메시지 처리기 코드를 추가 및/또는 기본값을 호출합니다.

	CRect rect;

	GetClientRect(&rect);

	CBrush myBrush(RGB(255, 255, 255));    // dialog background color <- 요기 바꾸면 됨.
	
	CBrush *pOld = pDC->SelectObject(&myBrush);

	BOOL bRes = pDC->PatBlt(0, 0, rect.Width(), rect.Height(), PATCOPY);

	pDC->SelectObject(pOld);    // restore old brush

	m_Grid.SetRedraw(true, true);

	return bRes;                       // 	return CDialog::OnEraseBkgnd(pDC);
}