Пример #1
0
        /// <summary>
        /// 加载线段
        /// </summary>
        /// <param name="line"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private Element LoadLine(RTSafe.DxfCore.Entities.Line line, int type)
        {
            var color = GetBrush(line.Color, line.Layer, type).Color;


            LineElement lineElement = new LineElement
            {
                Tag       = line.Layer.Name,
                R         = color.R,
                G         = color.G,
                B         = color.B,
                X         = line.StartPoint.X - MinX,
                Y         = MaxY - line.StartPoint.Y,
                X2        = line.EndPoint.X - MinX,
                Y2        = MaxY - line.EndPoint.Y,
                LayerName = line.Layer.Name
            };

            //line.Color.ToColor().Name;

            //line1.StrokeDashArray = new DoubleCollection();
            foreach (var item in line.LineType.Segments)
            {
                //line1.StrokeDashArray.Add(item);
            }
            return(lineElement);
        }
Пример #2
0
        /// <summary>
        /// 加载线段
        /// </summary>
        /// <param name="line"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        private LineElement LoadLine(RTSafe.DxfCore.Entities.Line line, int type)
        {
            LineElement lineElement = new LineElement();

            Line line1 = new Line();

            lineElement.Tag   = line.Layer.Name;
            lineElement.Color = GetBrush(line.Color, line.Layer, type);//line.Color.ToColor().Name;
            //line1.StrokeThickness = GetThickness(line.Thickness);
            lineElement.X1 = line.StartPoint.X - MinX;

            lineElement.Y1 = MaxY - line.StartPoint.Y;
            lineElement.X2 = line.EndPoint.X - MinX;
            lineElement.Y2 = MaxY - line.EndPoint.Y;
            //line1.StrokeDashArray = new DoubleCollection();
            foreach (var item in line.LineType.Segments)
            {
                //line1.StrokeDashArray.Add(item);
            }
            return(lineElement);
        }