Пример #1
0
        /// <summary>
        /// 加载文本
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        private TextElement LoadText(Text text, int type)
        {
            var         color       = GetBrush(text.Color, text.Layer, type).Color;
            TextElement textElement = new TextElement
            {
                Value = text.Value,
                R     = color.R,
                G     = color.G,
                B     = color.B,
                //Color = GetBrush(text.Color, text.Layer, type),
                Fontfamily = text.Style.Font,
                Size       = text.Style.Height,
                Height     = text.Height,
                LayerName  = text.Layer.Name
            };

            //new SolidBrush(Color.Black);//text.Color.ToColor().Name;////
            if (text.Rotation != 0)
            {
                //RotateTransform r = new RotateTransform();
                //r.Angle = -text.Rotation;
                //t.RenderTransform = r;
                //r.CenterY = text.Height;
            }

            textElement.X = text.BasePoint.X - MinX;
            textElement.Y = MaxY - text.BasePoint.Y + text.Height / 2;


            return(textElement);
        }
Пример #2
0
        /// <summary>
        /// 加载文本
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        private TextElement LoadText(Text text, int type)
        {
            TextElement textElement = new TextElement();

            //Text t = new Text();
            //.Value = text.Value;
            //t.Text = text.Value.Trim();
            //t. = text.Height;
            textElement.Value = text.Value;
            //text.Color = new AciColor(new Color());

            textElement.Color      = GetBrush(text.Color, text.Layer, type); //new SolidBrush(Color.Black);//text.Color.ToColor().Name;////
            textElement.Fontfamily = text.Style.Font;
            textElement.Size       = text.Style.Height;
            textElement.Height     = text.Height;
            if (text.Rotation != 0)
            {
                //RotateTransform r = new RotateTransform();
                //r.Angle = -text.Rotation;
                //t.RenderTransform = r;
                //r.CenterY = text.Height;
            }
            textElement.Start = new EPoint()
            {
                X = text.BasePoint.X - MinX, Y = MaxY - text.BasePoint.Y + text.Height / 2
            };

            return(textElement);
        }