• 网络学院
  • 新手学堂
  • 操作系统
  • 网络技术
  • 软件应用
  • 办公软件
  • 编程技术
  • 网站架设
  • 数据库类
  • 平面设计
  • 多媒体类
  • 游戏资讯
  • 教学论文
  • 认证考试
画带阴影效果的文字
广告位
  站点:
  • 首 页
  • 最新软件
  • 最新文章
  • 国内软件
  • 国外软件
  • 汉化软件
  • 源码下载
  • 字体下载
画带阴影效果的文字
软件发布 画带阴影效果的文字
网络软件 系统工具 应用软件 联络聊天 图形图像 多媒体类 行业软件 游戏娱乐 编程开发 安全相关 教育教学 数码软件
热门软件: QQ 瑞星 pplive e话通 木马克星 千千静听 office2000 五笔字根 Photoshop 视频分割
返回首页 | 文章首页 | 编程技术 | C#教程 | 画带阴影效果的文字

画带阴影效果的文字

 

添加时间: 2007-7-15 3:47:04  作者: C#教程  阅读次数:53   来源: http://www.d9soft.com

 

 

       

using System;
using System.Drawing;
using System.Drawing.Text;
using System.Drawing.Drawing2D;
using System.Collections;
using System.ComponentModel;
using System.<a href="http://dev.21tx.com/os/windows/" target="_blank">Windows</a>.Forms;
using System.Data;

namespace Window<a href="http://dev.21tx.com/corp/sap/" target="_blank">SAP</a>plication1
{
/// <summary>
/// Form1.的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
 /// <summary>
 /// 必需的设计器变量。
 /// </summary>

 private System.ComponentModel.Container components = null;
 private string TextToDraw = "【孟宪会之精彩世界】";

 public Form1()
 {
  //
  // Windows 窗体设计器支持所必需的
  //

  InitializeComponent();

  // 在 InitializeComponent 调用后添加任何构造函数代码

  this.SetStyle(ControlStyles.ResizeRedraw,true);

 }


 /// <summary>
 /// 清理所有正在使用的资源。
 /// </summary>

 protected override void Dispose( bool disposing )
 {
  if( disposing )
  {
   if (components != null)
   {
    components.Dispose();
   }
  }
  base.Dispose( disposing );
 }


 #region Windows Form Designer generated code
 /// <summary>
 /// 设计器支持所需的方法 - 不要使用代码编辑器修改
 /// 此方法的内容。
 /// </summary>
 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


 /// <summary>
 /// 应用程序入口点
 /// </summary>

 [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.Int<a href="http://dev.21tx.com/corp/solution/erp/" target="_blank">ERP</a>olationMode=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();
 }
}
}

 

 

 

上下文章:

 

上一篇文章: 在C#应用程序与DLL交互中使用消息 下一篇文章: 在C#中使用属性控件添加属性窗口

相关文章:

  • 模仿景深效果 用PS扫除杂乱背景
  • Photoshop简单的艺术化效果
  • 用Photoshop美发:焗油效果先知道
  • 利用PS通道快速打造梦幻紫色效果
  • Photoshop 照片转逼真手绘效果

相关软件:

  • 文文字符画 V2.3
  • QQ文字图片制造机 V6.0
  • 文字图画 V3.8
  • 多国文字点阵字库生成器 V3.8
  • 网页文字抓取器 V1.0
  • QQ七彩文字 V2006

 

 

快速导航

  • 网络学院
  • 精品汇聚
  • 字体下载
  • 教程下载
  • ASP源码
  • PHP源码
  • Net源码
  • JSP 源码

编程技术分类导航

  • ASP & ASP.NET教程
  • PHP教程
  • JSP教程
  • C/C++教程
  • VB & VB.NET教程
  • VC教程
  • Delphi教程
  • BCB教程
  • VFP教程
  • PB教程
  • JAVA教程
  • XML教程
  • C#教程
  • CGI教程

本类经典文章推荐

  • ADO.NET的开发场景及传统ADO的处理
  • 利用Visual C#实现Window管道技术
  • C#取得汉字的拼音的首字母
  • 使用C#编写DES加密程序的framework
  • Visual C#编写3D游戏框架示例
  • 用C#和本地Windows API操纵系统菜...
  • 在C#程序设计中使用Win32类库
  • Visual C#中调用Windows服务初探
  • 如何在C#的WinForm中制作饼状图和...
  • C#中实现DataGrid双向排序

C#教程阅读排行

  • 如何在C#的WinForm中制作饼状图和...
  • 浅析C#中图形编程
  • 用C#和本地Windows API操纵系统菜...
  • 彻底剖析C# 2.0泛型类的创建和使用
  • Visual C#编写3D游戏框架示例
  • 使用C#编写DES加密程序的framework
  • Visual C# 2005实现控件中捕获按键
  • Visual C#中调用Windows服务初探
  • C#如何在Form中嵌入并且操作Excel...
  • C#中利用mediaplayer打造mp3播放器

编程技术阅读总排行

  • VB入门教程之一
  • 第二章 PowerBuilder 入门之创建新...
  • Java连接数据库实例
  • 第一章 什么是PowerBuilder
  • VC++之List Box/Check List Box控...
  • VC++ List Ctrl控件
  • VC++ Combo Box/Combo Box Ex控件
  • 学C++不得不看的一篇文章
  • VB入门教程之二
  • VC++之Button控件

广告位置

字母检索 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 回到顶部

关于我们 | 版权声明 | 免责条款 | 广告联系 | 软件发布 | 下载帮助 | 下载排行 | 网站地图 | 特别鸣谢 | 友情连接

copyright; 2005-2008 D9soft.com 第九软件网 版权所有