示例#1
0
 public DrawEllipse(int x, int y, int width, int height, DrawingPens.PenType pType, Color fillColor, bool filled)
 {
     Rectangle = new Rectangle(x, y, width, height);
     DrawPen   = DrawingPens.SetCurrentPen(pType);
     PenType   = pType;
     FillColor = fillColor;
     Filled    = filled;
     Initialize();
 }
示例#2
0
 public DrawPolygon(int x1, int y1, int x2, int y2, DrawingPens.PenType p)
 {
     pointArray = new ArrayList();
     pointArray.Add(new Point(x1, y1));
     pointArray.Add(new Point(x2, y2));
     DrawPen = DrawingPens.SetCurrentPen(p);
     PenType = p;
     LoadCursor();
     Initialize();
 }
示例#3
0
        public DrawLine(int x1, int y1, int x2, int y2, DrawingPens.PenType p)
        {
            startPoint.X = x1;
            startPoint.Y = y1;
            endPoint.X   = x2;
            endPoint.Y   = y2;
            DrawPen      = DrawingPens.SetCurrentPen(p);
            PenType      = p;
            ZOrder       = 0;

            Initialize();
        }
示例#4
0
        /// <summary>
        /// Load object from serialization stream
        /// </summary>
        /// <param name="info"></param>
        /// <param name="orderNumber"></param>
        public virtual void LoadFromStream(SerializationInfo info, int orderNumber, int objectData)
        {
            int n = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryColor, orderNumber, objectData));

            Color = Color.FromArgb(n);

            PenWidth = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryPenWidth, orderNumber, objectData));

            PenType = (DrawingPens.PenType)info.GetValue(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryPen, orderNumber, objectData),
                typeof(DrawingPens.PenType));

            BrushType = (FillBrushes.BrushType)info.GetValue(
                string.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryBrush, orderNumber, objectData),
                typeof(FillBrushes.BrushType));

            n = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryFillColor, orderNumber, objectData));

            FillColor = Color.FromArgb(n);

            Filled = info.GetBoolean(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryFilled, orderNumber, objectData));
            //if(Curr
            ZOrder = info.GetInt32(
                String.Format(CultureInfo.InvariantCulture,
                              "{0}{1}-{2}",
                              entryZOrder, orderNumber, objectData));

            // Set the Pen and the Brush, if defined
            if (PenType != DrawingPens.PenType.Generic)
            {
                DrawPen = DrawingPens.SetCurrentPen(PenType);
            }
            if (BrushType != FillBrushes.BrushType.NoBrush)
            {
                DrawBrush = FillBrushes.SetCurrentBrush(BrushType);
            }
        }
示例#5
0
 private void doubleLineToolStripMenuItem_Click(object sender, EventArgs e)
 {
     drawArea.PenType    = DrawingPens.PenType.DoubleLinePen;
     drawArea.CurrentPen = DrawingPens.SetCurrentPen(DrawingPens.PenType.DoubleLinePen);
 }
示例#6
0
 private void redDotDashToolStripMenuItem_Click(object sender, EventArgs e)
 {
     drawArea.PenType    = DrawingPens.PenType.RedDotDashPen;
     drawArea.CurrentPen = DrawingPens.SetCurrentPen(DrawingPens.PenType.RedDotDashPen);
 }
示例#7
0
 private void greenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     drawArea.PenType    = DrawingPens.PenType.GreenPen;
     drawArea.CurrentPen = DrawingPens.SetCurrentPen(DrawingPens.PenType.GreenPen);
 }
示例#8
0
 private void toolStripMenuItemGenericPen_Click(object sender, EventArgs e)
 {
     drawArea.PenType    = DrawingPens.PenType.Generic;
     drawArea.CurrentPen = DrawingPens.SetCurrentPen(DrawingPens.PenType.Generic);
 }