写个小程序,,大家共同支持抗震救灾

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.Text;
using System.Drawing.Drawing2D;


namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {//使用文字线条轮廓创建窗体
            this.BackgroundImage = Image.FromFile("Water lilies.jpg");
            Graphics g = this.CreateGraphics();
            g.Clear(Color.White);
            //设定文本输出质量
            g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            g.SmoothingMode = SmoothingMode.AntiAlias;
            FontFamily MyFamily = new FontFamily("隶书");
            //创建路径区域
            GraphicsPath MyPath = new GraphicsPath();
            //向区域中追加文本
            StringFormat MyFormat = new StringFormat();
            Point MyPoint = new Point(0, 20);
            Point MyPoint1 = new Point(0,180);
            MyPath.AddString("一方有难", MyFamily, 0, 180, MyPoint, MyFormat);
            MyPath.AddString("八方支援", MyFamily, 0, 180, MyPoint1, MyFormat);
            Pen MyPen = new Pen(Color.Red);
            //绘制路径
            g.DrawPath(MyPen, MyPath);
            //从路径中构造区域
            this.Region = new System.Drawing.Region(MyPath);
        }
    }
}


原程序https://files.cnblogs.com/slcfhr/抗震救灾.rar

posted @ 2008-05-22 01:03  邵利超  阅读(651)  评论(0编辑  收藏  举报