Exemple #1
0
LRESULT CDemoView::OnNewImage(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	CDemoDoc* pDoc = GetDocument();
	pDoc->UpdateAllViews(0,WM_USER_NEWIMAGE);
	pDoc->UpdateStatusBar();
	return 0;
}
Exemple #2
0
void CDemoView::OnSetFocus(CWnd* pOldWnd) 
{
	CScrollView::OnSetFocus(pOldWnd);
	
	CDemoDoc* pDoc = GetDocument();
	if (pDoc) pDoc->UpdateStatusBar();
}
Exemple #3
0
void CDemoView::OnLButtonUp(UINT nFlags, CPoint point) 
{
	CDemoDoc* pDoc = GetDocument();

#if CXIMAGE_DEMO_SELECT
	if (pDoc && pDoc->m_tool == 1){
		CxImage* ima=pDoc->GetImage();
		if (ima){
			int i=pDoc->m_NumSel;
			if (i>2){
#ifdef VATI_EXTENSIONS
				if ( !pDoc->m_isRectSel )
				{
					pDoc->m_Sel[i].x = pDoc->m_Sel[0].x;
					pDoc->m_Sel[i].y = pDoc->m_Sel[0].y;
					pDoc->m_NumSel++;
				}
#else
				pDoc->m_Sel[i].x = pDoc->m_Sel[0].x;
				pDoc->m_Sel[i].y = pDoc->m_Sel[0].y;
				pDoc->m_NumSel++;
#endif
				SetTimer(1,333,NULL);
				
				long i;
				long n=pDoc->m_NumSel;
				POINT* p = (POINT*)malloc(n*sizeof(POINT));
				long h=ima->GetHeight();
				for(i=0;i<n;i++){
					p[i].x = pDoc->m_Sel[i].x;
					p[i].y = h-1-pDoc->m_Sel[i].y;
				}

				pDoc->Stopwatch(0);

				ima->SelectionClear();
				ima->SelectionAddPolygon(p,n);

				pDoc->Stopwatch(1);
				pDoc->UpdateStatusBar();

				free(p);
			} else {
				ima->SelectionDelete();
			}
			Invalidate(0);
		}
	}
#endif

	CScrollView::OnLButtonUp(nFlags, point);
}