void CScrollButtonWindow::_OnPaint(_In_ HDC dcHandle, _In_ PAINTSTRUCT *pps) { pps; RECT rc = {0, 0, 0, 0}; _GetClientRect(&rc); DrawFrameControl(dcHandle, &rc, DFC_SCROLL, subTypeOfControl | typeOfControl | (!_IsEnabled() ? DFCS_INACTIVE : 0)); }
void CScrollBarWindow::_Enable(BOOL isEnable) { if (_IsEnabled() != isEnable) { CBaseWindow::_Enable(isEnable); _pBtnUp->_Enable(isEnable); _pBtnDn->_Enable(isEnable); } }
void OpenCVPlotter::Initialize() { if (_IsEnabled()) { m_isDestroyed = false; m_Data->drawingsNum = 0; m_Data->autoRefreshStep = m_Data->autoRefreshStepDefault = m_hd.cfg.ValueOf("plotter.autoRefreshStep", 200); m_Data->borderSpace = m_hd.cfg.ValueOf("plotter.borderSpace", 5); //create window m_Data->windowName = m_hd.cfg.ValueOf("plotter.windowName", "itlPlace"); cvNamedWindow(m_Data->windowName.c_str()); //create image CvSize imgSize; m_Data->textSpaceHeight = m_hd.cfg.ValueOf("plotter.textSpaceHeight", 200); imgSize.height = m_hd.cfg.ValueOf("plotter.windowHeight", 700); int userHeight = imgSize.height - m_Data->textSpaceHeight; imgSize.width = (int)(userHeight * m_hd.Circuit.Width() / m_hd.Circuit.Height()); IMG = cvCreateImage(imgSize, IPL_DEPTH_8U, 3); IMG->origin = 1; //mark text field CvPoint startTextLine, finishTextLine; startTextLine.x = 0; startTextLine.y = m_Data->textSpaceHeight; finishTextLine.x = imgSize.width; finishTextLine.y = m_Data->textSpaceHeight; cvLine(IMG, startTextLine, finishTextLine, GetCvColor(Color_Black), 1); //calculate coordinate mapping m_Data->x_ratio = (imgSize.width - m_Data->borderSpace * 2) / m_hd.Circuit.Width(); m_Data->y_ratio = (userHeight - m_Data->borderSpace * 2) / m_hd.Circuit.Height(); m_Data->x_offset = -m_hd.Circuit.MinX(); m_Data->y_offset = -m_hd.Circuit.MinY() + m_Data->textSpaceHeight / m_Data->y_ratio ; //start video writing if (m_hd.cfg.ValueOf("plotter.createVideo", true) == true) StartVideoWriting("", ".\\video\\"); } }
void OpenCVPlotter::InitializeHistogramWindow() { if (!_IsEnabled() || !m_isHistogramDestroyed) return; m_isHistogramDestroyed = false; //create window m_Data->histogramWindowName = "itlPlace histogram"; cvNamedWindow(m_Data->histogramWindowName.c_str()); //create image CvSize imgSize; imgSize.height = m_hd.cfg.ValueOf("plotter.histogramWindowHeight", 300); imgSize.width = m_hd.cfg.ValueOf("plotter.histogramWindowWidth", 1000); m_Data->histogramImg = cvCreateImage(imgSize, IPL_DEPTH_8U, 3); m_Data->histogramImg->origin = 1; }
bool OpenCVPlotter::IsEnabled() { return !m_isDestroyed && _IsEnabled(); }