void OnTouchDownHandler(HWND hWnd, const TOUCHINPUT& ti) { // Create a new stroke, add a point, and assign a color to it. CStroke strkNew; POINT p = GetTouchPoint(hWnd, ti); strkNew.AddPoint(p); strkNew.SetColor(GetTouchColor((ti.dwFlags & TOUCHEVENTF_PRIMARY) != 0)); strkNew.SetId(ti.dwID); // Add the new stroke to the collection of strokes being drawn. g_StrkColDrawing.AddStroke(strkNew); }
BOOL CChildView::OnTouchInputDown(CPoint pt, PTOUCHINPUT pInput) { // Create new stroke and add point to it. COLORREF strokeColor = GetTouchColor((pInput->dwFlags & TOUCHEVENTF_PRIMARY) != 0); CStroke* pStrkNew = new CStroke(pInput->dwID, strokeColor); pStrkNew->Add(pt); // Add new stroke to the collection of strokes in drawing. m_StrkColDrawing.Add(pStrkNew); return TRUE; }