예제 #1
0
        private void RePaint()
        {
            using (Graphics gr = this.CreateGraphics())
            {
                for (int i = 0; i < draw.CurveCount; i++)
                {
                    JADA.Curve tempcv = draw.GetCurve(i);
                    Pen        myPen  = new Pen(Color.FromArgb(tempcv.Red, tempcv.Green, tempcv.Blue), tempcv.Width);

                    for (int j = 0; j < tempcv.CoordinatesCount - 1; j++)
                    {
                        int X1 = new int();
                        int Y1 = new int();
                        int X2 = new int();
                        int Y2 = new int();

                        tempcv.GetCoordinate(j, ref X1, ref Y1);
                        tempcv.GetCoordinate(j + 1, ref X2, ref Y2);

                        Point pt1 = new Point(X1, Y1);
                        Point pt2 = new Point(X2, Y2);

                        gr.DrawLine(myPen, pt1, pt2);
                    }
                    myPen.Dispose();
                }
            }
        }
예제 #2
0
파일: draw.cs 프로젝트: rleschiera/jada
        public int AddCurve(JADA.Curve crvSelf)
        {
            int iRet;

            iRet = JADA_DrwAddCurve(drwSelf, crvSelf.Self);
            return(iRet);
        }
예제 #3
0
 private void Form1_MouseDown(object sender, MouseEventArgs e)
 {
     prev      = e.Location;
     isdrawing = true;
     cv        = new JADA.Curve();
     cv.SetColor(color.A, color.R, color.G, color.B);
     cv.Width = penWidth;
 }
예제 #4
0
파일: draw.cs 프로젝트: rleschiera/jada
        public JADA.Curve GetCurve(int iIndex)
        {
            int    iRet;
            IntPtr crvPtr = new IntPtr();

            iRet = JADA_DrwGetCurve(drwSelf, iIndex, ref crvPtr);
            if (iRet == 0)
            {
                JADA.Curve crvSelf = new JADA.Curve(crvPtr);
                return(crvSelf);
            }
            else
            {
                return(null);
            }
        }
예제 #5
0
        public void Draw(JADA.Draw drwSelf)
        {
            int c, p;

            drwSelf.Duplicate();
            myCurves.Add(drwSelf);

            this.Invoke(new MethodInvoker(delegate
            {
                using (Graphics gr = Graphics.FromHdc(GetDC(this.Handle)))
                {
                    for (c = 0; c < drwSelf.CurveCount; c++)
                    {
                        JADA.Curve crvSelf = drwSelf.GetCurve(c);
                        Color myColor      = Color.FromArgb(crvSelf.Alpha, crvSelf.Red, crvSelf.Green, crvSelf.Blue);

                        using (Pen myPen = new Pen(myColor, crvSelf.Width))
                        {
                            if (crvSelf.CoordinatesCount > 1)
                            {
                                List <Point> points = new List <Point>();

                                for (p = 0; p <= crvSelf.CoordinatesCount - 1; p++)
                                {
                                    int X = 0, Y = 0;

                                    crvSelf.GetCoordinate(p, ref X, ref Y);
                                    points.Add(new Point(X, Y - SystemInformation.CaptionHeight));
                                    // JADA.Common.LogMessage(string.Format("DrawCurve: point {0} is {1},{2}\n", p, X, Y));
                                    // winagent.Globals.jadaSelf.LogMessage(string.Format("DrawCurve: point {0} is {1},{2}\n", p, X, Y));
                                }

                                gr.DrawCurve(myPen, points.ToArray(), 0.5f);
                            }
                        }
                    }
                }
            }));
        }