using
System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace testgrid
... {
public partial class GradientText : FontMenuForm
...{
public GradientText()
...{
Text = "Gradient Text";
Width *= 3;
strText = "Gradient";
font = new Font("Times New Roman", 144, FontStyle.Italic);
InitializeComponent();
}
protected override void DoPage(Graphics g, Color clr, int cx, int cy)
...{
//base.DoPage(g, clr, cx, cy);
SizeF sizef = g.MeasureString(strText, font);
PointF ptf = new PointF((cx - sizef.Width) / 2, (cy - sizef.Height) / 2);
RectangleF rectf = new RectangleF(ptf, sizef);
LinearGradientBrush lgbrush = new LinearGradientBrush(rectf, Color.White, Color.Black,LinearGradientMode.ForwardDiagonal);
// lgbrush.WrapMode = WrapMode.TileFlipXY;
g.Clear(Color.Gray);
g.DrawString(strText, font, lgbrush, ptf);
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace testgrid
... {
public partial class GradientText : FontMenuForm
...{
public GradientText()
...{
Text = "Gradient Text";
Width *= 3;
strText = "Gradient";
font = new Font("Times New Roman", 144, FontStyle.Italic);
InitializeComponent();
}
protected override void DoPage(Graphics g, Color clr, int cx, int cy)
...{
//base.DoPage(g, clr, cx, cy);
SizeF sizef = g.MeasureString(strText, font);
PointF ptf = new PointF((cx - sizef.Width) / 2, (cy - sizef.Height) / 2);
RectangleF rectf = new RectangleF(ptf, sizef);
LinearGradientBrush lgbrush = new LinearGradientBrush(rectf, Color.White, Color.Black,LinearGradientMode.ForwardDiagonal);
// lgbrush.WrapMode = WrapMode.TileFlipXY;
g.Clear(Color.Gray);
g.DrawString(strText, font, lgbrush, ptf);
}
}
}