예제 #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            StringFormat fffm = StringFormat.GenericDefault;

            fffm.Alignment = StringAlignment.Center;
            //var bmp = BitmapGenerator.DrawString(textBox1.Text, font, Rectangle.Empty, 0, 0, Color.Gray, Color.Transparent, System.Drawing.Text.TextRenderingHint.AntiAlias);
            var bmp = BitmapGenerator.DrawText(textBox1.Text, font, Rectangle.Empty, StringFormat.GenericDefault, 0, 0, new SolidBrush(Color.Gray), Color.Transparent, System.Drawing.Text.TextRenderingHint.AntiAlias);

            DrawstringBox.Image = bmp;
            DrawstringBox.Size  = bmp.Size;
        }
예제 #2
0
        private void refresh()
        {
            StringFormat fffm = StringFormat.GenericDefault;

            fffm.Alignment = StringAlignment.Center;
            var bmp = BitmapGenerator.DrawText(textBox1.Text, font, Rectangle.Empty, StringFormat.GenericDefault, 0, 0, new SolidBrush(Color.Gray), Color.Transparent, System.Drawing.Text.TextRenderingHint.AntiAlias);

            DrawstringBox.Image = bmp;
            DrawstringBox.Size  = bmp.Size;
            bmp             = BitmapGenerator.GetBitmap(textBox1.Text, font, Rectangle.Empty, Color.Gray, Color.Transparent, format, System.Drawing.Text.TextRenderingHint.AntiAlias);
            GetBmpBox.Image = bmp;
            GetBmpBox.Size  = bmp.Size;
        }
예제 #3
0
 private void Construct(string text, Color fcolor, Color bgcolor, float fontsize, string fontname, StringFormat format, FontStyle style, float linesp, float charsp)
 {
     this.text          = text;
     this.fontColor     = fcolor;
     this.bgColor       = bgcolor;
     this.FontSize      = fontsize;
     this.fontName      = fontname;
     this.format        = format;
     this.FontStyle     = style;
     this.LineSpacing   = linesp;
     this.CharSpacing   = charsp;
     this.Rect          = Rectangle.Empty;
     this.renderingHint = TextRenderingHint.AntiAlias;
     this.VerticalFont  = false;
     //this.font = new Font(this.fontName, this.FontSize, this.FontStyle);
     this.Drawer = txtobj =>
     {
         return(BitmapGenerator.DrawText(txtobj.text, txtobj.font, txtobj.Rect, txtobj.format, txtobj.LineSpacing,
                                         txtobj.CharSpacing, txtobj.Brush, txtobj.bgColor, txtobj.renderingHint));
     };
 }