Upload
merritt-shields
View
12
Download
0
Embed Size (px)
DESCRIPTION
Region of Interest Part II. Ku-Yaw Chang [email protected] Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University. Outline. Get DC Drawing Mode - XOR Complete ROI. Get DC. Provided by the framework void C***View::OnDraw(CDC* pDC) - PowerPoint PPT Presentation
Citation preview
Region of InterestRegion of InterestPart IIPart II
Ku-Yaw ChangKu-Yaw [email protected]@mail.dyu.edu.tw
Assistant Professor, Department of Assistant Professor, Department of Computer Science and Information EngineeringComputer Science and Information Engineering
Da-Yeh UniversityDa-Yeh University
222004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
OutlineOutline
Get DCGet DC
Drawing Mode - XORDrawing Mode - XOR
Complete ROIComplete ROI
332004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Get DCGet DC
Provided by the frameworkProvided by the framework void C***View::OnDraw(CDC* pDC)void C***View::OnDraw(CDC* pDC)
To obtain DC elsewhereTo obtain DC elsewhereCDC * pDC = GetDC();CDC * pDC = GetDC();
::
// use pDC …// use pDC …
::
ReleaseDC(pDC);ReleaseDC(pDC);
442004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Drawing Mode - XORDrawing Mode - XOR
AA BB A A B B
00 00 00
00 11 11
11 00 11
11 11 00
( A A B ) B ) B = A B = A
552004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Drawing Mode - XORDrawing Mode - XOR
Specifies the new drawing mode. Specifies the new drawing mode. pDC->SetROP2(R2_XORPEN);pDC->SetROP2(R2_XORPEN);
662004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Complete ROIComplete ROI
Add a state variable m_bLBtnDown into Add a state variable m_bLBtnDown into C***ViewC***View To keep track of the status of the mouse’s left To keep track of the status of the mouse’s left
buttonbutton Initialization : set to be ‘false’Initialization : set to be ‘false’ OnLButtonDown : set to be ‘true’OnLButtonDown : set to be ‘true’ OnLButtonUp : set to be ‘false’OnLButtonUp : set to be ‘false’
772004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Complete ROIComplete ROI
Use two variables to record the first and Use two variables to record the first and second points (C***View)second points (C***View) m_ptFirst and m_ptSecondm_ptFirst and m_ptSecond
OnLButtonDownOnLButtonDown m_ptFirst = point;m_ptFirst = point; m_ptSecond = point; m_ptSecond = point;
OnLButtonUpOnLButtonUp m_ptSecond = point; m_ptSecond = point;
882004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Complete ROIComplete ROI
OnMouseMoveOnMouseMove Check m_bLBtnDownCheck m_bLBtnDown Erase previous (old) ROIErase previous (old) ROI
m_ptFirst and m_ptSecondm_ptFirst and m_ptSecond m_ptSecond = point;m_ptSecond = point; Draw new ROIDraw new ROI
m_ptFirst and m_ptSecondm_ptFirst and m_ptSecond
992004/05/122004/05/12 Medical Imaging SystemMedical Imaging System
Other ConsiderationsOther Considerations
ScrollbarScrollbar CPoint GetScrollPosition()CPoint GetScrollPosition()
Display ratioDisplay ratio m_nDisplayRatiom_nDisplayRatio