* 程序的版权和版本声明部分
* Copyright (c) 2012, 烟台大学计算机学院学生
* All rights reserved.
* Copyright (c) 2012, 烟台大学计算机学院学生
* All rights reserved.
* 作 者: 刘镇
* 完成日期: 2012 年 11 月 25 日
* 版 本 号: 3.031
* 对任务及求解方法的描述部分
* 问题描述:实现绘制文字
*代码部分:
Form1.cs:
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;
namespace Win11_3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
TextureBrush brush = new TextureBrush(Image.FromFile("001.jpg"));
Font font = new Font("宋体", 60, FontStyle.Underline ^ FontStyle.Bold);
g.DrawString("呵呵!C#", font, brush, new Point(80, 10));
}
}
}
测试结果: