第十二周 C# 试验 《 3 》 .

private void Form1_Paint(object sender, PaintEventArgs e)

{

Graphics g = e.Graphics;

TextureBrush brush = new TextureBrush(Image.FromFile("p01.jpg"));

//创建字体

Font font = new Font("黑体",60, FontStyle.Underline ^ FontStyle.Bold);

g.DrawString("中国电力出版社", font, brush, new Point(10, 10));

}

 

 

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

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

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            TextureBrush brush = new TextureBrush(Image.FromFile("huguang.JPG"));
            //创建字体
            Font font = new Font("黑体", 60, FontStyle.Underline ^ FontStyle.Bold);
            g.DrawString("中国电力出版社", font, brush, new Point(10, 10));


}

        }
    }


第十二周 C# 试验 《 3 》 ._第1张图片

你可能感兴趣的:(第十二周 C# 试验 《 3 》 .)