mdi的視窗問題 |
尚未結案
|
octto741023
一般會員 ![]() ![]() 發表:13 回覆:3 積分:3 註冊:2008-11-25 發送簡訊給我 |
各位大大你們好!!
我目前是做ccd擷取畫面,但我現在想要利用mdi的方式去把畫面顯示再另一個視窗上面(只用一個form可以顯示畫面了), 請問要怎麼寫,我寫的方式有錯,可以跟我提供意見!!!! 以下是我的程式碼 (p.s.我算是剛完這個,拜託) //第一段 Form1 //--------------------------------------------------------------- void __fastcall TForm1::OnFormPaint(TObject *Sender) { TForm2 *Form2; // Protection if (m_pCurrent==NULL) return; // Get DC of the window HDC hDevice = GetDC (Handle); // Display picture SetDIBitsToDevice (hDevice, i, j, m_SizeX, m_SizeY, 0, 0, 0, m_SizeY, m_pCurrent, m_pBitmapInfo, DIB_RGB_COLORS); // Release DC ReleaseDC(Handle,hDevice); // Display channel info on status bar // Retrieve the channel state McGetParamInt (m_Channel, MC_ChannelState, &m_ChannelState); // Retrieve the frame rate double frameRate_Hz; McGetParamFloat(m_Channel, MC_PerSecond_Fr, &frameRate_Hz); // Display frame rate and channel state StatusBar1->SimpleText = m_StatusBarText.sprintf("Frame Rate: %.2f, Channel State: %s", frameRate_Hz, (m_ChannelState == MC_ChannelState_ACTIVE? "ACTIVE" : "NOT ACTIVE")); } //--------------------------------------------------------------------------- void WINAPI GlobalCallback (PMCSIGNALINFO SigInfo) { TForm2 *Form2; if (SigInfo && SigInfo->Context) { TForm1* pTForm1 = (TForm1*) SigInfo->Context ; pTForm1->Callback (SigInfo); } } //--------------------------------------------------------------------------- void TForm1::Callback(PMCSIGNALINFO SigInfo) { TForm2 *Form2; if (SigInfo->Signal == MC_SIG_SURFACE_PROCESSING) { // Update "current" surface address pointer McGetParamInt (SigInfo->SignalInfo, MC_SurfaceAddr, (PINT32) &m_pCurrent); // Post screen refresh message RECT recpict ; recpict.left =0; recpict.top =0; recpict.right = m_SizeX-1; recpict.bottom = m_SizeY -1; InvalidateRect(Handle,&recpict,false); } else if (SigInfo->Signal == MC_SIG_SURFACE_PROCESSING) { // Insert your failure handling code here. } } //第二段 Form2 //------------------------------------------------------------ // Post screen refresh message RECT recpict ; recpict.left =0; recpict.top =0; recpict.right = m_SizeX-1; recpict.bottom = m_SizeY -1; InvalidateRect(Handle,&recpict,false); } else if (SigInfo->Signal == MC_SIG_SURFACE_PROCESSING) { // Insert your failure handling code here. } } |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |