Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public static extern SHAPETYPE INK_RecognizeShape(CGStroke pStroke, int nStrokeCnt, SHAPETYPE inType);
Exemplo n.º 4
0
 private static extern SHAPETYPE INK_RecognizeShape(CGStroke[] pStroke, int nStrokeCnt, SHAPETYPE inType);
Exemplo n.º 5
0
 public static extern SHAPETYPE INK_RecognizeShape(CGStroke pStroke, int nStrokeCnt, SHAPETYPE inType);
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }