Example #1
0
        /// <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);
        }
Example #2
0
        /// <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);
        }
Example #3
0
 public static extern SHAPETYPE INK_RecognizeShape(CGStroke pStroke, int nStrokeCnt, SHAPETYPE inType);
Example #4
0
 private static extern SHAPETYPE INK_RecognizeShape(CGStroke[] pStroke, int nStrokeCnt, SHAPETYPE inType);
Example #5
0
 public static extern SHAPETYPE INK_RecognizeShape(CGStroke pStroke, int nStrokeCnt, SHAPETYPE inType);
Example #6
0
 /// <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;
 }
Example #7
0
        /// <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;
        }