예제 #1
0
        public void DrawScaledNumber(Graphics g, double value, float xCoord, float yCoord, float ScaleFactor, bool Horizontal)
        {
            pixelList = new List <Point>();
            CreateSegmentsList(value, ref pixelList, Horizontal);

            logicalList = new List <Point>();

            Point tmpLogicPoint = default(Point);

            for (int iIter = 0; iIter <= pixelList.Count - 1; iIter++)
            {
                if (pixelList[iIter].X != int.MaxValue)
                {
                    tmpLogicPoint.X = (int)(pixelList[iIter].X / ScaleFactor + xCoord);
                    tmpLogicPoint.Y = (int)(pixelList[iIter].Y / ScaleFactor + yCoord);
                    logicalList.Add(tmpLogicPoint);
                }
                else
                {
                    using (Pen pen = new Pen(GraphicsPropertiesManager.GetPropertiesByName("Ruler").Color,
                                             GraphicsPropertiesManager.GetPropertiesByName("Ruler").PenWidth))
                    {
                        g.DrawLines(pen, logicalList.ToArray());
                        logicalList.Clear();
                    }
                }
            }
        }
예제 #2
0
        public virtual void DrawTracker(Graphics g, ZWPictureBox pictureBox)
        {
            if (Selected)
            {
                SolidBrush brush = new SolidBrush(Color.White);
                Pen        pen   = new Pen(GraphicsPropertiesManager.GetPropertiesByName("Text").Color,
                                           GraphicsPropertiesManager.GetPropertiesByName("Text").PenWidth);

                for (int i = 1; i <= HandleCount; i++)
                {
                    if (!IsHandleVisible(i))
                    {
                        continue;
                    }

                    Rectangle r = GetHandleRectangle(pictureBox, i);
                    r.Offset(MovingOffset);
                    try
                    {
                        g.DrawRectangle(pen, r);
                        g.FillRectangle(brush, r);
                    }
                    catch (System.Exception ex)
                    {
                        Selected = false;
                    }
                }
                pen.Dispose();
                brush.Dispose();
            }
        }
예제 #3
0
 private void InitializeGraphicsProperties()
 {
     this.GraphicsProperties            = GraphicsPropertiesManager.GetPropertiesByName("Polygon");
     this.GraphicsProperties.DrawObject = this;
     this.GraphicsProperties.Color      = Color.LawnGreen;
     this.GraphicsProperties.Alpha      = (this.GraphicsProperties.Alpha == 0xFF || this.GraphicsProperties.Alpha == 0) ? 0xFF
         : this.GraphicsProperties.Alpha;
 }
예제 #4
0
 public static GraphicsPropertiesManager GraphicsManagerSingleInstance()
 {
     if (graphicsManager == null)
     {
         graphicsManager = new GraphicsPropertiesManager();
     }
     return(graphicsManager);
 }
예제 #5
0
 private void InitializeGraphicsProperties()
 {
     this.GraphicsProperties            = GraphicsPropertiesManager.GetPropertiesByName("Ellipse");
     this.GraphicsProperties.Color      = Color.Orange;
     this.GraphicsProperties.DrawObject = this;
     this.GraphicsProperties.Alpha      = (this.GraphicsProperties.Alpha == 0xFF || this.GraphicsProperties.Alpha == 0) ? 0xFF
         : this.GraphicsProperties.Alpha;
 }
예제 #6
0
 private void InitializeGraphicsProperties()
 {
     this.GraphicsProperties            = GraphicsPropertiesManager.GetPropertiesByName("Rectangle");
     this.GraphicsProperties.Color      = Color.BlueViolet;
     this.GraphicsProperties.DrawObject = this;
     this.GraphicsProperties.Alpha      = (this.GraphicsProperties.Alpha == 0xFF || this.GraphicsProperties.Alpha == 0) ? 0xFF
         : this.GraphicsProperties.Alpha;
 }
예제 #7
0
        public virtual void DrawTest(Graphics g, ZWPictureBox pictureBox)
        {
            SolidBrush brush = new SolidBrush(GraphicsPropertiesManager.GetPropertiesByName("Text").Color);
            RectangleF r     = GetTextF(this.Name, g, this.ID);

            r.Offset(MovingOffset);
            g.DrawString(this.Name, this.Font, brush, r);
            brush.Dispose();
        }
예제 #8
0
 public void Draw(Graphics g)
 {
     if (ShowRulers)
     {
         using (Pen pen = new Pen(GraphicsPropertiesManager.GetPropertiesByName("Ruler").Color,
                                  GraphicsPropertiesManager.GetPropertiesByName("Ruler").PenWidth))
         {
             g.ResetTransform();
             DrawHorizontalRuler(g, pen);
             DrawVerticalRuler(g, pen);
         }
     }
 }
예제 #9
0
        public override void DrawTracker(Graphics g, ZWPictureBox pictureBox)
        {
            if (!Selected)
            {
                return;
            }

            SolidBrush brush = new SolidBrush(Color.White);
            Pen        pen   = new Pen(GraphicsPropertiesManager.GetPropertiesByName("Text").Color,
                                       GraphicsPropertiesManager.GetPropertiesByName("Text").PenWidth);

            for (int i = 1; i <= HandleCount; i++)
            {
                Rectangle r = GetHandleRectangle(pictureBox, i);
                if (i <= PointCount)
                {
                    r.Offset(MovingOffset);
                }
                else
                {
                    brush.Color = Color.DarkGray;
                }

                try
                {
                    g.DrawRectangle(pen, r);
                    g.FillRectangle(brush, r);
                }
                catch (System.Exception ex)
                {
                    Selected = false;
                }
            }
            pen.Dispose();
            brush.Dispose();
        }
예제 #10
0
 private void InitializeGraphicsProperties()
 {
     this.GraphicsProperties       = GraphicsPropertiesManager.GetPropertiesByName("Circle");
     this.GraphicsProperties.Color = Color.Yellow;
 }