using System; using System.Drawing; using System.Drawing.Text; using System.Drawing.Drawing2D; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
Summary description of Namespace WindowsApplication1 {///
Private system.componentmodel.container components = null; private string texttodraw = "The Wonderful World of Mengxian]
Public Form1 () {// // Windows Form Designer Support for
InitializationComponent ();
// Add any constructor code after INITIALIZECOMPONENT call
THIS.SETSTYLE (ControlStyles.ResizeRedRAW, TRUE);
}
///
Protected Override Void Dispose (bool disposing) {if (disponents! = null) {components.dispose ();}} Base.Dispose (Disposing);
#Region Windows Form Designer Generated Code ///
}
#ndregion
///
[Stathread] static void main () {application.run (new form1 ());}
protected override void OnPaintBackground (PaintEventArgs e) {LinearGradientBrush b = new LinearGradientBrush (this.ClientRectangle, Color.Blue, Color.AliceBlue, 90f); e.Graphics.FillRectangle (b, this.ClientRectangle); b.Dispose ();} Private void form1_paint (Object sender, system.windows) {// Create a small Bitmap Bitmap BM = New Bitmap (this.clientsize.width / 4, this.clientsize.height / 4);
// Get Graphics object graphics g = graphics.FromImage (BM);
/ / Must use antialiased rendering hint g.textrenderinghint = textrenderingHint.antialias;
// this Matrix Zooms The Text Out to 1/4 Size and Offsets It by a little Right and Down
Matrix MX = New Matrix (0.25F, 0, 0, 0.25F, 3, 3);
g.Transform = MX;
// Draw a shadow
g.DrawString (TextToDraw, Font, new SolidBrush (Color.FromArgb (128, Color.Black)), 10, 10, StringFormat.GenericTypographic); g.Dispose (); e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; e. Graphics.TextRenderingHint = TextRenderingHint.AntiAlias; e.Graphics.DrawImage (bm, this.ClientRectangle, 0,0, bm.Width, bm.Height, GraphicsUnit.Pixel); e.Graphics.DrawString (TextToDraw, Font, Brushes.White , 10, 10, stringformat.GenericTyPographic; bm.dispose ();}}}