C#DrawString

来源:互联网 发布:淘宝开店点同意点不了 编辑:程序博客网 时间:2024/05/17 02:58
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 WindowsFormsApplication1{    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(@"pictur\bg.jpg"));            Font font = new Font("黑体", 60, FontStyle.Underline ^ FontStyle.Bold);            g.DrawString("烟台大学", font, brush, new Point(10, 10));        }      }}

0 0
原创粉丝点击