Exemple #1
0
        private static Bitmap createTextImage(ResizableTextBox textBox)
        {
            Font font = textBox.Font;
            Bitmap bitmap = new Bitmap(textBox.Width,textBox.Height);
            RectangleF layout = new RectangleF(0,0,textBox.Width,textBox.Height);

            Graphics graphics = Graphics.FromImage(bitmap);
            graphics.Clear(Color.White);
            graphics.SmoothingMode = SmoothingMode.AntiAlias;
            graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
            graphics.DrawString(textBox.Text,font,new SolidBrush(Color.Black),layout);
            graphics.Flush();

            return bitmap;
        }
Exemple #2
0
        public ResizableTextBox CreateResizableTextBox()
        {
            ResizableTextBox textBox = new ResizableTextBox();
            textBox.Name = "(empty) (Text Box)";
            textBox.Size = defaultTextBox;
            textBox.BorderStyle = BorderStyle.None;
            textBox.Multiline = true;
            textBox.Font = new Font("Arial",16F,FontStyle.Regular,GraphicsUnit.Point,(byte)0);
            textBox.ContextMenuStrip = this.objectRightClick;

            textBox.MouseUp += new MouseEventHandler(Control_MouseUp);
            textBox.KeyDown += new KeyEventHandler(TextBox_KeyDown);
            textBox.KeyUp += new KeyEventHandler(TextBox_KeyUp);
            textBox.GotFocus += new EventHandler(TextBox_GotFocus);
            textBox.Move += new EventHandler(Control_Move);
            return textBox;
        }
Exemple #3
0
 public TextInfo(ResizableTextBox textBox, int zindex, int fadeIn, int fadeOut)
     : base(zindex,fadeIn,fadeOut)
 {
     this.textBox = textBox;
 }
Exemple #4
0
 public ResizableTextBox CreateResizableTextBox(ResizableTextBox textBox)
 {
     ResizableTextBox newTextBox = CreateResizableTextBox();
     newTextBox.Text = textBox.Text;
     newTextBox.Name = textBox.Name;
     newTextBox.Size = textBox.Size;
     newTextBox.Location = textBox.Location;
     return newTextBox;
 }