Esempio n. 1
0
        /// <summary>
        /// 印刷のためのメインリストのデータの描画
        /// </summary>
        /// <param name="g"></param>
        /// <param name="scale"></param>
        protected void DrawMainForPrint(Graphics g, double scale, ulong layerFlags, uint option)
        {
            int       layerCount = MbeLayer.valueTable.Length;
            DrawParam dp         = new DrawParam();

            dp.g            = g;
            dp.mode         = MbeDrawMode.Print;
            dp.scale        = scale;
            dp.visibleLayer = layerFlags;
            dp.option       = option;

            //if(CenterPunchMode) dp.option |= (uint)MbeDrawOption.CenterPunchMode;
            //if(PrintToolMarkMode) dp.option |= (uint)MbeDrawOption.ToolMarkMode;
            //if (PrintColorMode) dp.option |= (uint)MbeDrawOption.PrintColor;

            for (int i = 0; i < layerCount; i++)
            {
                if ((layerFlags & (ulong)(MbeLayer.valueTable[i])) != 0)
                {
                    dp.layer = MbeLayer.valueTable[i];
                    foreach (MbeObj obj in document.MainList)
                    {
                        if (obj.DeleteCount < 0)
                        {
                            obj.Draw(dp);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 描画(abstract メソッド)
 /// </summary>
 /// <param name="dp"></param>
 public override void Draw(DrawParam dp)
 {
     refNum.Draw(dp);
     if (contentsObj != null)
     {
         foreach (MbeObj obj in contentsObj)
         {
             if (obj.Id() == MbeObjID.MbePTH ||
                 obj.Id() == MbeObjID.MbePinSMD ||
                 obj.Id() == MbeObjID.MbeHole)
             {
                 obj.Draw(dp);
             }
             else
             {
                 bool restoreDrawSnapMark = drawSnapMark;
                 drawSnapMark = false;
                 obj.Draw(dp);
                 drawSnapMark = restoreDrawSnapMark;
             }
         }
     }
     if (dp.mode != MbeDrawMode.Print && dp.layer == layer)
     {
         Point pt0 = this.GetPos(0);
         pt0 = ToDrawDim(pt0, dp.scale);
         int marksize = (int)(10000 / dp.scale);
         if (marksize < 5)
         {
             marksize = 5;
         }
         DrawSnapPointMark(dp.g, pt0, marksize, selectFlag[0]);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// メインリストのデータの描画
        /// </summary>
        /// <param name="g"></param>
        /// <param name="scale"></param>
        protected void DrawMain(Graphics g, double scale)
        {
            int       layerCount = MbeLayer.valueTable.Length;
            DrawParam dp         = new DrawParam();

            dp.g            = g;
            dp.mode         = MbeDrawMode.Draw;
            dp.scale        = scale;
            dp.visibleLayer = visibleLayer;


            //ulong visibleLayer = document.docInfo.VisibleLayer;

            for (int i = 0; i < layerCount; i++)
            {
                if ((visibleLayer & (ulong)(MbeLayer.valueTable[i])) != 0)
                {
                    dp.layer = MbeLayer.valueTable[i];
                    foreach (MbeObj obj in document.MainList)
                    {
                        if (obj.DeleteCount < 0)
                        {
                            obj.Draw(dp);
                        }
                    }
                }
            }
        }
Esempio n. 4
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            if (!enablePaint)
            {
                return;
            }

            Size     sizeClient = ClientSize;
            Graphics g          = e.Graphics;

            g.Clear(MbeColors.ColorBackground);
            Point ptScroll    = AutoScrollPosition;
            int   scrollWidth = AutoScrollMinSize.Width - sizeClient.Width;

            if (scrollWidth < 0)
            {
                scrollWidth = 0;
            }

            int scrollHeight = AutoScrollMinSize.Height - sizeClient.Height;

            if (scrollHeight < 0)
            {
                scrollHeight = 0;
            }


            g.TranslateTransform(sizeClient.Width / 2 + (ptScroll.X + scrollWidth / 2), sizeClient.Height / 2 + (ptScroll.Y + scrollHeight / 2));

            int       layerCount = MbeLayer.valueTable.Length;
            DrawParam dp         = new DrawParam();

            dp.g            = g;
            dp.mode         = MbeDrawMode.Draw;
            dp.scale        = displayScale;
            dp.visibleLayer = 0xFFFFFFFFFFFFFFFF;

            for (int i = 0; i < layerCount; i++)
            {
                //if ((visibleLayer & (ulong)(MbeLayer.valueTable[i])) != 0) {
                dp.layer = MbeLayer.valueTable[i];
                mbeComponent.Draw(dp);
            }
        }
Esempio n. 5
0
        public override void Draw(DrawParam dp)
        {
            if (((ulong)dp.layer & snapLayer) == 0)
            {
                return;
            }

            if (((ulong)dp.layer & ((ulong)MbeLayer.LayerValue.STS |
                                    (ulong)MbeLayer.LayerValue.STC)) != 0)
            {
                if (no_ResistMask)
                {
                    return;
                }
            }


            Point pt = this.GetPos(0);

            pt = ToDrawDim(pt, dp.scale);

            Color col;
            //Color cold;
            int w = 0;
            int h = 0;
            //int wd = 0;
            //int hd = 0;
            Rectangle  rc;
            SolidBrush brush;
            Pen        pen;


            #region 描画サイズの設定

            switch (dp.layer)
            {
            case MbeLayer.LayerValue.PLC:
            case MbeLayer.LayerValue.PLS:
            case MbeLayer.LayerValue.CMP:
            case MbeLayer.LayerValue.SOL:
                w = (int)(PadSize.Width / dp.scale) | 1;
                h = (int)(PadSize.Height / dp.scale) | 1;
                break;

            case MbeLayer.LayerValue.STC:
            case MbeLayer.LayerValue.STS:
                //if (no_ResistMask) return;  //Version 0.50
                w = (int)((PadSize.Width + SrMargin * 2) / dp.scale) | 1;
                h = (int)((PadSize.Height + SrMargin * 2) / dp.scale) | 1;
                break;

            case MbeLayer.LayerValue.MMC:
            case MbeLayer.LayerValue.MMS:
                if (no_MM)
                {
                    return;
                }
                w = (int)((PadSize.Width - MmReduce * 2) / dp.scale) | 1;
                h = (int)((PadSize.Height - MmReduce * 2) / dp.scale) | 1;
                break;
            }
            if (w == 1)
            {
                w++;
            }
            if (h == 1)
            {
                h++;
            }
            //if ((dp.layer == MbeLayer.LayerValue.PTH) || (dp.layer == MbeLayer.LayerValue.DRL)) {
            //    wd = (int)(Diameter / dp.scale) | 1;

            //    if (dp.layer == MbeLayer.LayerValue.PTH) {
            //        if (wd >= w) wd = w - 2;
            //        if (wd >= h) wd = h - 2;
            //    }
            //    hd = wd;
            //}



            #endregion

            #region 色の設定
            if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;
                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.PLC:
                        nColor = MbeColors.PRINT_PLC;
                        break;

                    case MbeLayer.LayerValue.PLS:
                        nColor = MbeColors.PRINT_PLS;
                        break;

                    case MbeLayer.LayerValue.CMP:
                        nColor = MbeColors.PRINT_CMP;
                        break;

                    case MbeLayer.LayerValue.SOL:
                        nColor = MbeColors.PRINT_SOL;
                        break;

                    case MbeLayer.LayerValue.STC:
                        nColor = MbeColors.PRINT_STC;
                        break;

                    case MbeLayer.LayerValue.MMC:
                        nColor = MbeColors.PRINT_MMC;
                        break;

                    case MbeLayer.LayerValue.MMS:
                        nColor = MbeColors.PRINT_MMS;
                        break;

                    default:
                        nColor = MbeColors.PRINT_STS;
                        break;
                    }

                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_PRINT_ALPHA, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.PLC:
                    nColor = MbeColors.PLC;
                    break;

                case MbeLayer.LayerValue.PLS:
                    nColor = MbeColors.PLS;
                    break;

                case MbeLayer.LayerValue.CMP:
                    nColor = MbeColors.CMP;
                    break;

                case MbeLayer.LayerValue.SOL:
                    nColor = MbeColors.SOL;
                    break;

                case MbeLayer.LayerValue.STC:
                    nColor = MbeColors.STC;
                    break;

                case MbeLayer.LayerValue.MMC:
                    nColor = MbeColors.MMC;
                    break;

                case MbeLayer.LayerValue.MMS:
                    nColor = MbeColors.MMS;
                    break;

                //case MbeLayer.LayerValue.STS:
                default:
                    nColor = MbeColors.STS;
                    break;
                    //	break;
                    //case MbeLayer.LayerValue.DRL:
                    //default:
                    //    nColor = MbeColors.Drl;
                    //    break;
                }

                if (dp.mode == MbeDrawMode.Temp || connectionCheckActive)
                {
                    col = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }
            }
            #endregion

            #region 実際の描画の実行
            switch (dp.layer)
            {
            case MbeLayer.LayerValue.PLC:
            case MbeLayer.LayerValue.PLS:
            case MbeLayer.LayerValue.CMP:
            case MbeLayer.LayerValue.SOL:
            case MbeLayer.LayerValue.STC:
            case MbeLayer.LayerValue.STS:
            case MbeLayer.LayerValue.MMC:
            case MbeLayer.LayerValue.MMS:
                rc = new Rectangle(pt.X - w / 2, pt.Y - h / 2, w, h);

                if (Shape == PadShape.Rect)
                {
                    brush = new SolidBrush(col);
                    dp.g.FillRectangle(brush, rc);
                    brush.Dispose();
                }
                else
                {
                    if (w == h)
                    {
                        brush = new SolidBrush(col);
                        dp.g.FillEllipse(brush, rc);
                        brush.Dispose();
                    }
                    else
                    {
                        pen          = new Pen(col, (w < h ? w : h));
                        pen.StartCap = LineCap.Round;
                        pen.EndCap   = LineCap.Round;
                        if (w < h)
                        {
                            int k = (h - w + 1) / 2;
                            dp.g.DrawLine(pen, pt.X, pt.Y - k, pt.X, pt.Y + k);
                        }
                        else
                        {
                            int k = (w - h + 1) / 2;
                            dp.g.DrawLine(pen, pt.X - k, pt.Y, pt.X + k, pt.Y);
                        }
                        pen.Dispose();
                    }
                }

                if (dp.layer == MbeLayer.LayerValue.PLC ||
                    dp.layer == MbeLayer.LayerValue.PLS ||
                    dp.layer == MbeLayer.LayerValue.CMP ||
                    dp.layer == MbeLayer.LayerValue.SOL)
                {
                    //if (wd >= 3) {
                    //    rc = new Rectangle(pt.X - wd / 2, pt.Y - hd / 2, wd, hd);
                    //    brush = new SolidBrush(MbeColors.ColorBackground);
                    //    dp.g.FillEllipse(brush, rc);
                    //    brush.Dispose();
                    //}
                    //if (DrawSnapMarkFlag) {
                    if (dp.mode != MbeDrawMode.Print)
                    {
                        if (drawSnapMark)
                        {
                            int marksize = (w < h ? w : h) / 2;
                            DrawSnapPointMark(dp.g, pt, marksize, selectFlag[0]);
                            //}
                            if (dp.layer == MbeLayer.LayerValue.CMP ||
                                dp.layer == MbeLayer.LayerValue.SOL)
                            {
                                if (DrawPinNumFlag)
                                {
                                    int  fontsize = (w < h ? w : h) / 2;        //高さと幅の小さい方
                                    bool vertical = (w < h);                    //幅が大きければ縦書き
                                    DrawPinNum(dp.g, PinNum, pt, fontsize, vertical);
                                }
                            }
                        }
                    }
                }
                break;
                //case MbeLayer.LayerValue.DRL:
                //    rc = new Rectangle(pt.X - wd / 2, pt.Y - hd / 2, wd, hd);
                //    pen = new Pen(col);
                //    dp.g.DrawEllipse(pen, rc);
                //    pen.Dispose();
                //    break;
            }
            #endregion
        }
Esempio n. 6
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="dp"></param>
        public override void Draw(DrawParam dp)
        {
            if (posCount < 3)
            {
                return;
            }
            if (dp.layer != Layer)
            {
                return;
            }
            Color col;
            int   w = 0;
            Pen   pen;

            //描画幅の設定
            if (restrictMask)
            {
                w = 1;
            }
            else
            {
                w = (int)(TraceWidth / dp.scale) | 1;
            }



            if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;
                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.CMP:
                        nColor = MbeColors.PRINT_CMP;
                        break;

                    case MbeLayer.LayerValue.L2:
                        nColor = MbeColors.PRINT_L2;
                        break;

                    case MbeLayer.LayerValue.L3:
                        nColor = MbeColors.PRINT_L3;
                        break;

                    default:            //case MbeLayer.LayerValue.SOL:
                        nColor = MbeColors.PRINT_SOL;
                        break;
                    }
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_PRINT_ALPHA, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.CMP:
                    nColor = MbeColors.CMP;
                    break;

                case MbeLayer.LayerValue.L2:
                    nColor = MbeColors.L2;
                    break;

                case MbeLayer.LayerValue.L3:
                    nColor = MbeColors.L3;
                    break;

                default:        //case MbeLayer.LayerValue.SOL:
                    nColor = MbeColors.SOL;
                    break;
                }

                if (dp.mode == MbeDrawMode.Temp || connectionCheckActive)
                {
                    col = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }
            }

            Point pt0;
            Point pt1;

            if (MbeView.ViewPolygonFrame)
            {
                pen = new Pen(col, 1);

                if (!restrictMask)
                {
                    pen.DashStyle = DashStyle.Dash;
                    pt0           = ToDrawDim(posArray[0], dp.scale);
                    pt1           = ToDrawDim(posArray[1], dp.scale);
                    dp.g.DrawLine(pen, pt0, pt1);
                }

                pen.Width     = w;
                pen.DashStyle = DashStyle.Solid;
                if (restrictMask && !Program.monoRuntime)
                {
                    Point[] drawPointArray = new Point[posCount - 1];
                    for (int i = 1; i < posCount; i++)
                    {
                        drawPointArray[i - 1] = ToDrawDim(posArray[i], dp.scale);
                    }
                    Color      bgcolor = Color.FromArgb(0, 0, 0, 0);
                    HatchBrush brush   = new HatchBrush(HatchStyle.Percent20, col, bgcolor);
                    dp.g.FillPolygon(brush, drawPointArray);
                    brush.Dispose();
                    dp.g.DrawPolygon(pen, drawPointArray);
                    drawPointArray = null;
                }
                else
                {
                    HatchBrush brush = null;
                    if (!Program.monoRuntime && !Program.inhibitHatchBrushPolygonframe)
                    {
                        Color bgcolor = Color.FromArgb(col.A, ((int)col.R) * 2 / 3, ((int)col.G) * 2 / 3, ((int)col.B) * 2 / 3);
                        brush     = new HatchBrush(HatchStyle.Percent30, col, bgcolor);
                        pen.Brush = brush;
                    }

                    pen.StartCap = LineCap.Round;
                    pen.EndCap   = LineCap.Round;
                    for (int i = 1; i < posCount; i++)
                    {
                        int index2 = i + 1;
                        if (index2 == posCount)
                        {
                            index2 = 1;
                        }
                        pt0 = ToDrawDim(posArray[i], dp.scale);
                        pt1 = ToDrawDim(posArray[index2], dp.scale);
                        //System.Diagnostics.Debug.WriteLine("Frame  " + pt0.X + "," + pt0.Y + "," + pt1.X + "," + pt1.Y);
                        dp.g.DrawLine(pen, pt0, pt1);
                    }
                    if (brush != null)
                    {
                        brush.Dispose();
                    }
                }

                pen.Dispose();

                if (drawSnapMark && dp.mode != MbeDrawMode.Print)
                {
                    for (int i = 0; i < posCount; i++)
                    {
                        pt0 = ToDrawDim(posArray[i], dp.scale);
                        int marksize = w;
                        if (i == 0)
                        {
                            if (!restrictMask)
                            {
                                if (marksize < 10)
                                {
                                    marksize = 10;
                                }
                                DrawTargetMark(dp.g, pt0, marksize, selectFlag[i]);
                            }
                        }
                        else
                        {
                            DrawSnapPointMark(dp.g, pt0, marksize, selectFlag[i]);
                        }
                    }
                }
            }
            else
            {
                if (fillLineList.Count > 0)
                {
                    pen          = new Pen(col);
                    pen.StartCap = LineCap.Round;
                    pen.EndCap   = LineCap.Round;
                    foreach (MbeGapChkObjLine obj in fillLineList)
                    {
                        pen.Width = (int)(obj.lineWidth / dp.scale) | 1;
                        pt0       = ToDrawDim(obj.p0, dp.scale);
                        pt1       = ToDrawDim(obj.p1, dp.scale);
                        //System.Diagnostics.Debug.WriteLine("Fill  "+pt0.X + "," + pt0.Y + "," + pt1.X + "," + pt1.Y);
                        dp.g.DrawLine(pen, pt0, pt1);
                    }
                    pen.Dispose();
                }
            }
        }
Esempio n. 7
0
 /// <summary>
 /// 描画(abstract メソッド)
 /// </summary>
 /// <param name="dp"></param>
 public abstract void Draw(DrawParam dp);
Esempio n. 8
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="dp"></param>
        public override void Draw(DrawParam dp)
        {
            if (((ulong)dp.layer & ((ulong)MbeLayer.LayerValue.PTH |
                                    (ulong)MbeLayer.LayerValue.STS |
                                    (ulong)MbeLayer.LayerValue.STC |
                                    (ulong)MbeLayer.LayerValue.DRL)) == 0)
            {
                return;
            }

            if (((ulong)dp.layer & ((ulong)MbeLayer.LayerValue.STS |
                                    (ulong)MbeLayer.LayerValue.STC)) != 0)
            {
                if (no_ResistMask)
                {
                    return;
                }
            }

            Point pt = this.GetPos(0);

            pt = ToDrawDim(pt, dp.scale);

            Color col;
            //Color cold;
            int        w  = 0;
            int        h  = 0;
            int        wd = 0;
            int        hd = 0;
            Rectangle  rc;
            SolidBrush brush;
            Pen        pen;


            #region 描画サイズの設定

            switch (dp.layer)
            {
            case MbeLayer.LayerValue.PTH:
                w = (int)(PadSize.Width / dp.scale) | 1;
                h = (int)(PadSize.Height / dp.scale) | 1;
                break;

            case MbeLayer.LayerValue.STC:
            case MbeLayer.LayerValue.STS:
                w = (int)((PadSize.Width + SrMargin * 2) / dp.scale) | 1;
                h = (int)((PadSize.Height + SrMargin * 2) / dp.scale) | 1;
                break;
            }
            if (w == 1)
            {
                w++;
            }
            if (h == 1)
            {
                h++;
            }
            if ((dp.layer == MbeLayer.LayerValue.PTH) || (dp.layer == MbeLayer.LayerValue.DRL))
            {
                int drillDia;
                if ((dp.option & (uint)MbeDrawOption.CenterPunchMode) != 0)
                {
                    drillDia = PrintCenterPunchModeDiameter(Diameter);
                }
                else
                {
                    drillDia = Diameter;
                }

                wd = (int)(drillDia / dp.scale) | 1;

                if (dp.layer == MbeLayer.LayerValue.PTH)
                {
                    if (wd >= w)
                    {
                        wd = w - 2;
                    }
                    if (wd >= h)
                    {
                        wd = h - 2;
                    }
                }
                hd = wd;
            }



            #endregion

            #region 色の設定
            if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;
                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.PTH:
                        nColor = MbeColors.PRINT_PTH;
                        break;

                    case MbeLayer.LayerValue.STC:
                        nColor = MbeColors.PRINT_STC;
                        break;

                    case MbeLayer.LayerValue.STS:
                        nColor = MbeColors.PRINT_STS;
                        break;

                    case MbeLayer.LayerValue.DRL:
                    default:
                        nColor = MbeColors.PRINT_DRL;
                        break;
                    }

                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_PRINT_ALPHA, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.PTH:
                    nColor = MbeColors.PTH;
                    break;

                case MbeLayer.LayerValue.STC:
                    nColor = MbeColors.STC;
                    break;

                case MbeLayer.LayerValue.STS:
                    nColor = MbeColors.STS;
                    break;

                case MbeLayer.LayerValue.DRL:
                default:
                    nColor = MbeColors.DRL;
                    break;
                }

                if (dp.mode == MbeDrawMode.Temp || connectionCheckActive)
                {
                    col = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }
            }
            #endregion

            #region 実際の描画の実行
            switch (dp.layer)
            {
            case MbeLayer.LayerValue.PTH:
            case MbeLayer.LayerValue.STC:
            case MbeLayer.LayerValue.STS:
                rc = new Rectangle(pt.X - w / 2, pt.Y - h / 2, w, h);

                if (Shape == PadShape.Rect)
                {
                    brush = new SolidBrush(col);
                    dp.g.FillRectangle(brush, rc);
                    brush.Dispose();
                }
                else
                {
                    if (w == h)
                    {
                        brush = new SolidBrush(col);
                        dp.g.FillEllipse(brush, rc);
                        brush.Dispose();
                    }
                    else
                    {
                        pen          = new Pen(col, (w < h ? w : h));
                        pen.StartCap = LineCap.Round;
                        pen.EndCap   = LineCap.Round;
                        if (w < h)
                        {
                            int k = (h - w + 1) / 2;
                            dp.g.DrawLine(pen, pt.X, pt.Y - k, pt.X, pt.Y + k);
                        }
                        else
                        {
                            int k = (w - h + 1) / 2;
                            dp.g.DrawLine(pen, pt.X - k, pt.Y, pt.X + k, pt.Y);
                        }
                        pen.Dispose();
                    }
                }
                if (dp.layer == MbeLayer.LayerValue.PTH)
                {
                    if (dp.mode != MbeDrawMode.Print)
                    {
                        if (wd >= 3)
                        {
                            rc = new Rectangle(pt.X - wd / 2, pt.Y - hd / 2, wd, hd);
                            Color cold = MbeColors.ColorBackground;
                            if (dp.mode == MbeDrawMode.Temp)
                            {
                                cold = Color.FromArgb(MBE_OBJ_ALPHA, cold);
                            }
                            brush = new SolidBrush(cold);
                            //brush = new SolidBrush(MbeColors.ColorBackground);
                            dp.g.FillEllipse(brush, rc);
                            brush.Dispose();
                        }
                        if (drawSnapMark)
                        {
                            int marksize = (w < h ? w : h) / 2;
                            DrawSnapPointMark(dp.g, pt, marksize, selectFlag[0]);
                        }
                        if (DrawPinNumFlag)
                        {
                            int  fontsize = (w < h ? w : h) / 2;                                        //高さと幅の小さい方
                            bool vertical = (w < h);                                                    //幅が大きければ縦書き
                            DrawPinNum(dp.g, PinNum, pt, fontsize, vertical);
                        }
                    }
                    else
                    {
                        rc    = new Rectangle(pt.X - wd / 2, pt.Y - hd / 2, wd, hd);
                        brush = new SolidBrush(Color.White);
                        dp.g.FillEllipse(brush, rc);
                        brush.Dispose();
                    }
                }
                break;

            case MbeLayer.LayerValue.DRL:
                rc = new Rectangle(pt.X - wd / 2, pt.Y - hd / 2, wd, hd);
                if (dp.mode == MbeDrawMode.Print)
                {
                    brush = new SolidBrush(Color.White);
                    dp.g.FillEllipse(brush, rc);
                    brush.Dispose();
                    if ((dp.visibleLayer & (ulong)MbeLayer.LayerValue.PTH) == 0)
                    {
                        int penw = (int)(500 / dp.scale) | 1;

                        if ((dp.option & (uint)MbeDrawOption.ToolMarkMode) != 0)
                        {
                            if ((dp.visibleLayer & MbeLayer.PatternFilmLayer) == 0)
                            {
                                MbeView.DrawDrillMark(GetPos(0), Diameter, dp, col, penw);
                                return;
                            }
                        }



                        pen = new Pen(col, penw);
                        dp.g.DrawEllipse(pen, rc);
                        pen.Dispose();
                    }
                }
                else
                {
                    pen = new Pen(col);
                    dp.g.DrawEllipse(pen, rc);
                    pen.Dispose();
                }
                break;
            }
            #endregion
        }
Esempio n. 9
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="dp"></param>
        public override void Draw(DrawParam dp)
        {
            if (dp.layer != Layer)
            {
                return;
            }
            Point pt0 = this.GetPos(0);

            pt0 = ToDrawDim(pt0, dp.scale);

            Color col;
            int   w = 0;
            int   h = 0;

            //bool reverse = false;

            //描画幅の設定
            w = (int)(LineWidth / dp.scale) | 1;

            //描画文字高さの設定
            h = (int)(TextHeight / dp.scale);

            if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;
                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.PLC:
                        nColor = MbeColors.PRINT_PLC;
                        break;

                    case MbeLayer.LayerValue.PLS:
                        nColor = MbeColors.PRINT_PLS;
                        //reverse = true;
                        break;

                    case MbeLayer.LayerValue.STC:
                        nColor = MbeColors.PRINT_STC;
                        break;

                    case MbeLayer.LayerValue.STS:
                        nColor = MbeColors.PRINT_STS;
                        //reverse = true;
                        break;

                    case MbeLayer.LayerValue.CMP:
                        nColor = MbeColors.PRINT_CMP;
                        break;

                    case MbeLayer.LayerValue.L2:
                        nColor = MbeColors.PRINT_L2;
                        break;

                    case MbeLayer.LayerValue.L3:
                        nColor = MbeColors.PRINT_L3;
                        break;

                    case MbeLayer.LayerValue.SOL:
                        nColor = MbeColors.PRINT_SOL;
                        //reverse = true;
                        break;

                    case MbeLayer.LayerValue.DIM:
                        nColor = MbeColors.PRINT_DIM;
                        break;

                    default:
                        nColor = MbeColors.PRINT_DOC;
                        break;
                    }
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(255, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.PLC:
                    nColor = MbeColors.PLC;
                    break;

                case MbeLayer.LayerValue.PLS:
                    nColor = MbeColors.PLS;
                    //reverse = true;
                    break;

                case MbeLayer.LayerValue.STC:
                    nColor = MbeColors.STC;
                    break;

                case MbeLayer.LayerValue.STS:
                    nColor = MbeColors.STS;
                    //reverse = true;
                    break;

                case MbeLayer.LayerValue.CMP:
                    nColor = MbeColors.CMP;
                    break;

                case MbeLayer.LayerValue.L2:
                    nColor = MbeColors.L2;
                    break;

                case MbeLayer.LayerValue.L3:
                    nColor = MbeColors.L3;
                    break;

                case MbeLayer.LayerValue.SOL:
                    nColor = MbeColors.SOL;
                    //reverse = true;
                    break;

                case MbeLayer.LayerValue.DIM:
                    nColor = MbeColors.DIM;
                    break;

                default:
                    nColor = MbeColors.DOC;
                    break;
                }

                if (dp.mode == MbeDrawMode.Temp)
                {
                    col = Color.FromArgb(255, MbeColors.HighLighten(nColor));
                    //col = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(255, col);
                }
            }

            bool reverse = false;

            switch (dp.layer)
            {
            case MbeLayer.LayerValue.PLS:
            case MbeLayer.LayerValue.STS:
            case MbeLayer.LayerValue.SOL:
                reverse = true;
                break;

            default:
                reverse = false;
                break;
            }

            //文字列描画にアルファブレンドを使うかどうかの判定
            bool bDrawUsingAlphaBlend = true;

            if (Program.drawTextSolidly)
            {
                bDrawUsingAlphaBlend = false;
            }
            else if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) == 0)   //白黒印刷時はアルファブレンドにしない
                {
                    bDrawUsingAlphaBlend = false;
                }
            }


            if (dp.layer != MbeLayer.LayerValue.DOC)
            {
                GraphicsState gState = dp.g.Save();                     //座標系保存


                dp.g.TranslateTransform(pt0.X, pt0.Y);
                if (dir != 0)
                {
                    dp.g.RotateTransform(-dir);
                }
                if (reverse)
                {
                    dp.g.ScaleTransform(-1.0F, 1.0F);
                }



                if (bDrawUsingAlphaBlend)
                {
                    int    drawWidth = MbeBoardFont.DrawWidth(h, signame);
                    int    buffCX    = drawWidth + w + w;
                    int    buffCY    = h + w + w;
                    Bitmap bmp       = new Bitmap(buffCX, buffCY);


                    Graphics gBmp  = Graphics.FromImage(bmp);
                    Color    colBg = Color.FromArgb(unchecked ((int)MbeColors.Background));
                    gBmp.Clear(colBg);
                    MbeView.boardFont.DrawString(gBmp, w, h + w, false, signame, h, w, col);

                    ColorMatrix cm = new ColorMatrix();
                    cm.Matrix00 = 1.0F;
                    cm.Matrix11 = 1.0F;
                    cm.Matrix22 = 1.0F;
                    cm.Matrix33 = 0.5F;
                    cm.Matrix44 = 1.0F;



                    ImageAttributes ia = new ImageAttributes();
                    ia.SetColorMatrix(cm);
                    ia.SetColorKey(colBg, colBg);

                    Rectangle rc = new Rectangle(-w, w - buffCY, buffCX, buffCY);
                    dp.g.DrawImage(bmp, rc, 0, 0, buffCX, buffCY, GraphicsUnit.Pixel, ia);
                }
                else
                {
                    MbeView.boardFont.DrawString(dp.g, 0, 0, false, signame, h, w, col);
                }
                dp.g.Restore(gState);                                   //座標系復帰
            }
            else
            {
                if (bDrawUsingAlphaBlend)
                {
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }

                if (h >= 2)
                {
                    Font         font   = new Font(FontFamily.GenericSerif, h, GraphicsUnit.Pixel);
                    Brush        brush  = new SolidBrush(col);
                    StringFormat format = new StringFormat(StringFormatFlags.NoClip);
                    format.Alignment     = StringAlignment.Near;
                    format.LineAlignment = StringAlignment.Far;

                    GraphicsState gState = dp.g.Save();                         //座標系保存
                    dp.g.TranslateTransform(pt0.X, pt0.Y);
                    if (dir != 0)
                    {
                        dp.g.RotateTransform(-dir);
                    }
                    dp.g.DrawString(signame, font, brush, new PointF(0, 0), format);
                    dp.g.Restore(gState);                                                       //座標系復帰

                    format.Dispose();
                    brush.Dispose();
                    font.Dispose();
                }
            }


            if (drawSnapMark && dp.mode != MbeDrawMode.Print)
            {
                int marksize = h / 3;
                if (marksize > 20)
                {
                    marksize = 20;
                }
                DrawSnapPointMark(dp.g, pt0, marksize, selectFlag[0]);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 描画(abstract メソッド)
        /// </summary>
        /// <param name="dp"></param>
        public override void Draw(DrawParam dp)
        {
            if (dp.layer != Layer)
            {
                return;
            }

            //0.46.04 描画ズレの低減
            //0.49.02 描画ズレの低減
            Point lt = GetPos(0);
            Point rb = lt;

            lt.Offset(-Radius, Radius);
            lt = ToDrawDim(lt, dp.scale);
            rb.Offset(Radius, -Radius);
            rb = ToDrawDim(rb, dp.scale);


            int drawWidth  = rb.X - lt.X;
            int drawHeight = rb.Y - lt.Y;



            if (drawWidth == 0)         //0.49.20
            {
                drawWidth = 1;
            }
            if (drawHeight == 0)        //0.49.20
            {
                drawHeight = 1;
            }


            Rectangle rc = new Rectangle(lt.X, lt.Y, drawWidth, drawHeight);


            Color col;
            int   w = 0;
            Pen   pen;


            //描画幅の設定
            w = (int)(LineWidth / dp.scale) | 1;

            if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;
                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.PLC:
                        nColor = MbeColors.PRINT_PLC;
                        break;

                    case MbeLayer.LayerValue.PLS:
                        nColor = MbeColors.PRINT_PLS;
                        break;

                    case MbeLayer.LayerValue.STC:
                        nColor = MbeColors.PRINT_STC;
                        break;

                    case MbeLayer.LayerValue.STS:
                        nColor = MbeColors.PRINT_STS;
                        break;

                    case MbeLayer.LayerValue.CMP:
                        nColor = MbeColors.PRINT_CMP;
                        break;

                    case MbeLayer.LayerValue.L2:
                        nColor = MbeColors.PRINT_L2;
                        break;

                    case MbeLayer.LayerValue.L3:
                        nColor = MbeColors.PRINT_L3;
                        break;

                    case MbeLayer.LayerValue.SOL:
                        nColor = MbeColors.PRINT_SOL;
                        break;

                    case MbeLayer.LayerValue.DIM:
                        nColor = MbeColors.PRINT_DIM;
                        break;

                    default:
                        nColor = MbeColors.PRINT_DOC;
                        break;
                    }
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_PRINT_ALPHA, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.PLC:
                    nColor = MbeColors.PLC;
                    break;

                case MbeLayer.LayerValue.PLS:
                    nColor = MbeColors.PLS;
                    break;

                case MbeLayer.LayerValue.STC:
                    nColor = MbeColors.STC;
                    break;

                case MbeLayer.LayerValue.STS:
                    nColor = MbeColors.STS;
                    break;

                case MbeLayer.LayerValue.CMP:
                    nColor = MbeColors.CMP;
                    break;

                case MbeLayer.LayerValue.L2:
                    nColor = MbeColors.L2;
                    break;

                case MbeLayer.LayerValue.L3:
                    nColor = MbeColors.L3;
                    break;

                case MbeLayer.LayerValue.SOL:
                    nColor = MbeColors.SOL;
                    break;

                case MbeLayer.LayerValue.DIM:
                    nColor = MbeColors.DIM;
                    break;

                default:
                    nColor = MbeColors.DOC;
                    break;
                }

                if (dp.mode == MbeDrawMode.Temp || connectionCheckActive)
                {
                    col = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }
            }

            pen          = new Pen(col, w);
            pen.StartCap = LineCap.Round;
            pen.EndCap   = LineCap.Round;

            int sweepAngle;

            if (LimitStartEnd())
            {
                sweepAngle = 3600;
            }
            else if (StartAngle > EndAngle)
            {
                sweepAngle = 3600 - StartAngle + EndAngle;
            }
            else
            {
                sweepAngle = EndAngle - StartAngle;
            }
            if (drawWidth > 0)
            {
                dp.g.DrawArc(pen, rc, ((float)-StartAngle) / 10, ((float)-sweepAngle) / 10);
            }
            pen.Dispose();

            if (drawSnapMark && dp.mode != MbeDrawMode.Print)
            {
                Point pt0 = GetPos(0);
                Point pt1 = GetPos(1);
                Point pt2 = GetPos(2);
                pt0 = ToDrawDim(pt0, dp.scale);
                pt1 = ToDrawDim(pt1, dp.scale);
                pt2 = ToDrawDim(pt2, dp.scale);

                int marksize = (int)(drawWidth / 10);
                if (marksize < 10)
                {
                    marksize = 10;
                }
                DrawSnapPointMark(dp.g, pt0, marksize, selectFlag[0]);

                marksize = w;
                if (marksize < 5)
                {
                    marksize = 5;
                }
                if (!selectFlag[2])
                {
                    DrawSnapPointMark(dp.g, pt2, marksize, selectFlag[2]);
                    DrawSnapPointMark(dp.g, pt1, marksize, selectFlag[1]);
                }
                else
                {
                    DrawSnapPointMark(dp.g, pt1, marksize, selectFlag[1]);
                    DrawSnapPointMark(dp.g, pt2, marksize, selectFlag[2]);
                }
            }
        }
Esempio n. 11
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="dp"></param>
        public override void Draw(DrawParam dp)
        {
            if (((ulong)dp.layer & ((ulong)MbeLayer.LayerValue.STS |
                                    (ulong)MbeLayer.LayerValue.STC |
                                    (ulong)MbeLayer.LayerValue.DRL)) == 0)
            {
                return;
            }

            //if (dp.layer != MbeLayer.LayerValue.DRL) return;

            Point pt = this.GetPos(0);

            pt = ToDrawDim(pt, dp.scale);

            Color col;
            Color cold;
            //int w = 0;
            //int h = 0;
            int wd = 0;
            //int hd = 0;
            Rectangle  rc;
            SolidBrush brush;
            Pen        pen;
            bool       centerPunchMode = false;

            int drillDia;

            if ((dp.option & (uint)MbeDrawOption.CenterPunchMode) != 0)
            {
                drillDia        = PrintCenterPunchModeDiameter(Diameter);
                centerPunchMode = true;
            }
            else
            {
                drillDia = Diameter;
            }


            switch (dp.layer)
            {
            case MbeLayer.LayerValue.DRL:
                wd = (int)(drillDia / dp.scale) | 1;
                break;

            case MbeLayer.LayerValue.STC:
            case MbeLayer.LayerValue.STS:
                wd = (int)((Diameter + DEFAULT_SRMARGIN * 2) / dp.scale) | 1;
                break;
            }


            //wd = (int)(Diameter / dp.scale) | 1;


            #region 色の設定
            if (dp.mode == MbeDrawMode.Print)
            {
                cold = Color.White;
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;

                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.STC:
                        nColor = MbeColors.PRINT_STC;
                        break;

                    case MbeLayer.LayerValue.STS:
                        nColor = MbeColors.PRINT_STS;
                        break;

                    case MbeLayer.LayerValue.DRL:
                    default:
                        nColor = MbeColors.PRINT_DRL;
                        break;
                    }
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_PRINT_ALPHA, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.STC:
                    nColor = MbeColors.STC;
                    break;

                case MbeLayer.LayerValue.STS:
                    nColor = MbeColors.STS;
                    break;

                case MbeLayer.LayerValue.DRL:
                default:
                    nColor = MbeColors.DRL;
                    break;
                }

                cold = MbeColors.ColorBackground;
                if (dp.mode == MbeDrawMode.Temp)
                {
                    col  = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                    cold = Color.FromArgb(0x20, cold);
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }
            }
            #endregion


            rc = new Rectangle(pt.X - wd / 2, pt.Y - wd / 2, wd, wd);

            if (dp.layer == MbeLayer.LayerValue.DRL)
            {
                if (dp.mode != MbeDrawMode.Print)
                {
                    cold = Color.FromArgb(0x90, cold);
                }
                brush = new SolidBrush(cold);
                dp.g.FillEllipse(brush, rc);
                brush.Dispose();

                //DRLレイヤーへの描画では、輪郭を描く。
                //印刷時はプリンタの能力に左右されにくいように幅を設定する。
                //センターポンチモードでは、感光基板による自作を想定してやや太めのラインとする。
                int w = 1;

                if (dp.mode == MbeDrawMode.Print)
                {
                    if (centerPunchMode && (dp.visibleLayer & ((ulong)MbeLayer.LayerValue.PTH |
                                                               (ulong)MbeLayer.LayerValue.CMP |
                                                               (ulong)MbeLayer.LayerValue.SOL)) != 0)
                    {
                        w = 1000;
                    }
                    else
                    {
                        w = 500;
                    }

                    w = (int)(w / dp.scale) | 1;

                    if ((dp.option & (uint)MbeDrawOption.ToolMarkMode) != 0)
                    {
                        if ((dp.visibleLayer & MbeLayer.PatternFilmLayer) == 0)
                        {
                            MbeView.DrawDrillMark(GetPos(0), Diameter, dp, col, w);
                            return;
                        }
                    }
                }
                pen = new Pen(col, w);
                dp.g.DrawEllipse(pen, rc);
                pen.Dispose();
                if (drawSnapMark && dp.mode != MbeDrawMode.Print)
                {
                    int marksize = wd / 2;
                    DrawSnapPointMark(dp.g, pt, marksize, selectFlag[0]);
                }
            }
            else
            {
                brush = new SolidBrush(col);
                dp.g.FillEllipse(brush, rc);
                brush.Dispose();
            }
        }
Esempio n. 12
0
        /// <summary>
        /// 描画
        /// </summary>
        /// <param name="dp"></param>
        public override void Draw(DrawParam dp)
        {
            if (dp.layer != Layer)
            {
                return;
            }
            Point pt0 = this.GetPos(0);
            Point pt1 = this.GetPos(1);
            Point ptVia;

            //両端点が一致していたら描画しない。Version 0.48.02 2009/04/24
            if (pt0.X == pt1.X && pt0.Y == pt1.Y)
            {
                return;
            }

            bool bendMode = getPointVia(out ptVia);

            //折れ曲がり点が端点と一致していたら、折れ曲がり線ではないと見做す。Version 0.48.02 2009/04/24
            if (bendMode)
            {
                if ((pt0.X == ptVia.X && pt0.Y == ptVia.Y) || (pt1.X == ptVia.X && pt1.Y == ptVia.Y))
                {
                    bendMode = false;
                }
                else
                {
                    ptVia = ToDrawDim(ptVia, dp.scale);
                }
            }

            pt0 = ToDrawDim(pt0, dp.scale);
            pt1 = ToDrawDim(pt1, dp.scale);


            Color col;
            int   w = 0;
            Pen   pen;


            //描画幅の設定
            w = (int)(LineWidth / dp.scale) | 1;

            if (dp.mode == MbeDrawMode.Print)
            {
                if ((dp.option & (uint)MbeDrawOption.PrintColor) != 0)      //カラー印刷
                {
                    uint nColor;
                    switch (dp.layer)
                    {
                    case MbeLayer.LayerValue.PLC:
                        nColor = MbeColors.PRINT_PLC;
                        break;

                    case MbeLayer.LayerValue.PLS:
                        nColor = MbeColors.PRINT_PLS;
                        break;

                    case MbeLayer.LayerValue.MMC:
                        nColor = MbeColors.PRINT_MMC;
                        break;

                    case MbeLayer.LayerValue.MMS:
                        nColor = MbeColors.PRINT_MMS;
                        break;

                    case MbeLayer.LayerValue.STC:
                        nColor = MbeColors.PRINT_STC;
                        break;

                    case MbeLayer.LayerValue.STS:
                        nColor = MbeColors.PRINT_STS;
                        break;

                    case MbeLayer.LayerValue.CMP:
                        nColor = MbeColors.PRINT_CMP;
                        break;

                    case MbeLayer.LayerValue.L2:
                        nColor = MbeColors.PRINT_L2;
                        break;

                    case MbeLayer.LayerValue.L3:
                        nColor = MbeColors.PRINT_L3;
                        break;

                    case MbeLayer.LayerValue.SOL:
                        nColor = MbeColors.PRINT_SOL;
                        break;

                    case MbeLayer.LayerValue.DIM:
                        nColor = MbeColors.PRINT_DIM;
                        break;

                    default:
                        nColor = MbeColors.PRINT_DOC;
                        break;
                    }
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_PRINT_ALPHA, col);
                }
                else
                {
                    col = Color.Black;
                }
            }
            else
            {
                uint nColor;
                switch (dp.layer)
                {
                case MbeLayer.LayerValue.PLC:
                    nColor = MbeColors.PLC;
                    break;

                case MbeLayer.LayerValue.PLS:
                    nColor = MbeColors.PLS;
                    break;

                case MbeLayer.LayerValue.MMC:
                    nColor = MbeColors.MMC;
                    break;

                case MbeLayer.LayerValue.MMS:
                    nColor = MbeColors.MMS;
                    break;

                case MbeLayer.LayerValue.STC:
                    nColor = MbeColors.STC;
                    break;

                case MbeLayer.LayerValue.STS:
                    nColor = MbeColors.STS;
                    break;

                case MbeLayer.LayerValue.CMP:
                    nColor = MbeColors.CMP;
                    break;

                case MbeLayer.LayerValue.L2:
                    nColor = MbeColors.L2;
                    break;

                case MbeLayer.LayerValue.L3:
                    nColor = MbeColors.L3;
                    break;

                case MbeLayer.LayerValue.SOL:
                    nColor = MbeColors.SOL;
                    break;

                case MbeLayer.LayerValue.DIM:
                    nColor = MbeColors.DIM;
                    break;

                default:
                    nColor = MbeColors.DOC;
                    break;
                }

                if (dp.mode == MbeDrawMode.Temp || connectionCheckActive)
                {
                    col = Color.FromArgb(MBE_OBJ_ALPHA, MbeColors.HighLighten(nColor));
                }
                else
                {
                    col = Color.FromArgb(unchecked ((int)nColor));
                    col = Color.FromArgb(MBE_OBJ_ALPHA, col);
                }
            }

            pen          = new Pen(col, w);
            pen.StartCap = LineCap.Round;
            pen.EndCap   = LineCap.Round;
            if (!bendMode)
            {
                //Version 0.48.02 非常に短いラインデータの描画が消えないようにする
                //DrawLine()を直接使わずに、メンバーのDrawLineData()を呼ぶ
                //dp.g.DrawLine(pen, pt0, pt1);
                DrawLineData(dp.g, pen, pt0, pt1);
            }
            else
            {
                //Version 0.48.02 非常に短いラインデータの描画が消えないようにする
                //DrawLine()を直接使わずに、メンバーのDrawLineData()を呼ぶ
                //dp.g.DrawLine(pen, pt0, ptVia);
                //dp.g.DrawLine(pen, ptVia, pt1);
                DrawLineData(dp.g, pen, pt0, ptVia);
                DrawLineData(dp.g, pen, ptVia, pt1);
            }
            pen.Dispose();

            if (drawSnapMark && dp.mode != MbeDrawMode.Print)
            {
                int marksize = w;
                DrawSnapPointMark(dp.g, pt0, marksize, selectFlag[0]);
                DrawSnapPointMark(dp.g, pt1, marksize, selectFlag[1]);
            }
        }