/// <summary> /// Add stroke to ink /// </summary> /// <param name="inkData">Pointer to ink data</param> /// <param name="currentStroke">Stroke as a polyline</param> /// <returns></returns> public static bool AddStroke(IntPtr inkData, Polyline currentStroke) { if (currentStroke.Points.Count == 0) { return(false); } var pointArray = new CGStroke[currentStroke.Points.Count]; for (var i = 0; i < currentStroke.Points.Count; i++) { pointArray[i].pressure = 127; pointArray[i].pt.x = (float)currentStroke.Points[i].X; pointArray[i].pt.y = (float)currentStroke.Points[i].Y; } INK_AddStroke(inkData, pointArray, pointArray.Length, (int)currentStroke.StrokeThickness - 1, ColorToCOLORREF(((SolidColorBrush)currentStroke.Stroke).Color)); return(false); }
/// <summary> /// Add stroke to ink /// </summary> /// <param name="inkData">Pointer to ink data</param> /// <param name="currentStroke">Stroke as a polyline</param> /// <returns></returns> public static bool AddStroke(IntPtr inkData, List <Point> currentStroke) { if (currentStroke.Count == 0) { return(false); } var pointArray = new CGStroke[currentStroke.Count]; for (var i = 0; i < currentStroke.Count; i++) { pointArray[i].pressure = 127; pointArray[i].pt.x = currentStroke[i].X; pointArray[i].pt.y = currentStroke[i].Y; } INK_AddStroke(inkData, pointArray, pointArray.Length, DEFAULT_INK_WIDTH, ColorToCOLORREF(Color.Black)); return(false); }
public static extern SHAPETYPE INK_RecognizeShape(CGStroke pStroke, int nStrokeCnt, SHAPETYPE inType);
private static extern SHAPETYPE INK_RecognizeShape(CGStroke[] pStroke, int nStrokeCnt, SHAPETYPE inType);
/// <summary> /// Add stroke to ink /// </summary> /// <param name="inkData">Pointer to ink data</param> /// <param name="currentStroke">Stroke as a polyline</param> /// <returns></returns> public static bool AddStroke(IntPtr inkData, Polyline currentStroke) { if (currentStroke.Points.Count == 0) return false; var pointArray = new CGStroke[currentStroke.Points.Count]; for (var i = 0; i < currentStroke.Points.Count; i++) { pointArray[i].pressure = 127; pointArray[i].pt.x = (float)currentStroke.Points[i].X; pointArray[i].pt.y = (float)currentStroke.Points[i].Y; } INK_AddStroke(inkData, pointArray, pointArray.Length, (int)currentStroke.StrokeThickness - 1, ColorToCOLORREF(((SolidColorBrush)currentStroke.Stroke).Color)); return false; }
/// <summary> /// Add stroke to ink /// </summary> /// <param name="inkData">Pointer to ink data</param> /// <param name="currentStroke">Stroke as a polyline</param> /// <returns></returns> public static bool AddStroke(IntPtr inkData, List<Point> currentStroke) { if (currentStroke.Count == 0) return false; var pointArray = new CGStroke[currentStroke.Count]; for (var i = 0; i < currentStroke.Count; i++) { pointArray[i].pressure = 127; pointArray[i].pt.x = currentStroke[i].X; pointArray[i].pt.y = currentStroke[i].Y; } INK_AddStroke(inkData, pointArray, pointArray.Length, DEFAULT_INK_WIDTH, ColorToCOLORREF(Color.Black)); return false; }