为了正常的体验网站,请在浏览器设置里面开启Javascript功能!

画带阴影效果的文字

2017-12-04 5页 doc 17KB 11阅读

用户头像

is_003124

暂无简介

举报
画带阴影效果的文字画带阴影效果的文字 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; namespace WindowsApplication1 { /// /// Form1.的摘要说明。...
画带阴影效果的文字
画带阴影效果的文字 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; namespace WindowsApplication1 { /// /// Form1.的摘要说明。 /// public class Form1 : System.Windows.Forms.Form { /// /// 必需的设计器变量。 /// private System.ComponentModel.Container components = null; private string TextToDraw = "【孟宪会之精彩世界】"; public Form1() { // // Windows 窗体设计器支持所必需的 // InitializeComponent(); // 在 InitializeComponent 调用后添加任何构造#数#代码 this.SetStyle(ControlStyles.ResizeRedraw,true); } /// /// 清理所有正在使用的资源。 /// protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// 设计器支持所需的 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(16, 36); this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(376, 293); this.Font = new System.Drawing.Font("Tahoma", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Name = "Form1"; this.Text = "Form1"; this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); } #endregion /// /// 应用程序入口点 /// [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.Forms.PaintEventArgs e) { // 创建一个小的Bitmap Bitmap bm = new Bitmap(this.ClientSize.Width/4,this.ClientSize.Height/4); //得到 Graphics 对象 Graphics g = Graphics.FromImage(bm); // 必须使用 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; // 画阴影 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(); } } }
/
本文档为【画带阴影效果的文字】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索