90 likes | 108 Views
Learn how to integrate drawing mode XOR in a medical imaging system to complete Region of Interest (ROI) functionality. Understand setting the drawing mode, tracking mouse button status, recording points, and handling scrollbars for precision display ratios. Perfect for developers seeking advanced ROI implementations.
E N D
Region of InterestPart II Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University
Outline • Get DC • Drawing Mode - XOR • Complete ROI Medical Imaging System
Get DC • Provided by the framework • void C***View::OnDraw(CDC* pDC) • To obtain DC elsewhere CDC * pDC = GetDC(); : // use pDC … : ReleaseDC(pDC); Medical Imaging System
Drawing Mode - XOR ( A B ) B = A Medical Imaging System
Drawing Mode - XOR • Specifies the new drawing mode. • pDC->SetROP2(R2_XORPEN); Medical Imaging System
Complete ROI • Add a state variable m_bLBtnDown into C***View • To keep track of the status of the mouse’s left button • Initialization : set to be ‘false’ • OnLButtonDown : set to be ‘true’ • OnLButtonUp : set to be ‘false’ Medical Imaging System
Complete ROI • Use two variables to record the first and second points (C***View) • m_ptFirst and m_ptSecond • OnLButtonDown • m_ptFirst = point; • m_ptSecond = point; • OnLButtonUp • m_ptSecond = point; Medical Imaging System
Complete ROI • OnMouseMove • Check m_bLBtnDown • Erase previous (old) ROI • m_ptFirst and m_ptSecond • m_ptSecond = point; • Draw new ROI • m_ptFirst and m_ptSecond Medical Imaging System
Other Considerations • Scrollbar • CPoint GetScrollPosition() • Display ratio • m_nDisplayRatio Medical Imaging System