Ejemplo n.º 1
0
        //public static ShapeBase CreateArrowEntity(float scaleFactor)
        //{
        //    ArrowShape arrow = new ArrowShape();
        //    arrow.StartPoint.Copy(0, 20 * scaleFactor, 0);
        //    arrow.StartPoint.Copy(20 * scaleFactor, 30 * scaleFactor, 0);
        //    arrow.Color = Color.Cyan;

        //    return arrow;
        //}

        public static ShapeBase CreateTextEntity(float scaleFactor)
        {
            HorizontalText text = new HorizontalText();

            text.Text         = "A";
            text.TextHeight   = 5 * scaleFactor;
            text.FontFaceName = "Arial";
            text.FontStyle    = FontStyle.Regular;
            text.Location.X   = 0;
            text.Location.Y   = 25 * scaleFactor;
            text.Angle        = (float)(30f / 180 * Math.PI);
            text.Color        = Color.Violet;

            return(text);
        }
Ejemplo n.º 2
0
        public string[] OnMoveForward(Canvas canvas)
        {
            string outOfRange = $"{horizontalTextBlock[0].Text}.{horizontalTextBlock[0].ToolTip}";

            HorizontalText.Clear();

            for (int i = 1; i < horizontalTextBlock.Count; i++)
            {
                horizontalTextBlock[i - 1].ToolTip = horizontalTextBlock[i].ToolTip;
                horizontalTextBlock[i - 1].Text    = horizontalTextBlock[i].Text;

                HorizontalText.Add($"{horizontalTextBlock[i - 1].Text}.{horizontalTextBlock[i - 1].ToolTip}");
            }

            DayOffset++;
            horizontalTextBlock[^ 1].ToolTip = $"{DateTime.Today.AddDays(DayOffset).Month}.{DateTime.Today.AddDays(DayOffset).Year}";
Ejemplo n.º 3
0
        private void CreateAndPrintText()
        {
            pictureBox1.Refresh();

            var font1 = new Font("Arial Black", 24f, FontStyle.Bold);
            var font2 = new Font("Corbel", 18f, FontStyle.Italic);
            var font3 = new Font("Imprint MT Shadow", 44f, FontStyle.Regular);

            var horisontal = new HorizontalText();
            var vertical   = new VerticalText();

            baseWrites.AddRange(Create(horisontal, "Horizontal", font1, StringAlignment.Near, 6));
            baseWrites.AddRange(Create(horisontal, "Horizontal", font2, StringAlignment.Center, 7));
            baseWrites.AddRange(Create(vertical, "Vertical", font3, StringAlignment.Near, 1));

            textOutput.DrawText(pictureBox1.CreateGraphics(), startPoint, baseWrites);
        }
Ejemplo n.º 4
0
        private static void AddTextBox(VectorImage vectorImage, HorizontalText textBoxShape, DistanceUnit currentUnit)
        {
            TextShape textShape = new TextShape();

            textShape.Location    = textBoxShape.Location.Clone();
            textShape.Angle       = textBoxShape.Angle;
            textShape.ItalicAngle = textBoxShape.ItalicAngle;

            textShape.ScaleX          = textBoxShape.ScaleX;
            textShape.ScaleY          = textBoxShape.ScaleY;
            textShape.TextBoxHeight   = textBoxShape.TextBoxHeight;
            textShape.TextBoxWidth    = textBoxShape.TextBoxWidth;
            textShape.LineSpace       = textBoxShape.LineSpace;
            textShape.LineSpaceStyle  = textBoxShape.LineSpaceStyle;
            textShape.HorizontalAlign = textBoxShape.HorizontalAlign;
            textShape.VerticalAlign   = textBoxShape.VerticalAlign;
            textShape.WordWrap        = textBoxShape.WordWrap;
            textShape.Kerning         = textBoxShape.Kerning;

            textShape.AddText(textBoxShape.Text, textBoxShape.FontFaceName, textBoxShape.FontStyle, textBoxShape.TextHeight, 0);
            vectorImage.AddTextShape(textShape);
        }