c#用graphic里面能用小数画图吗
1个回答
展开全部
以下是一个最简单的实例:
using System;
using System.Windows.Forms;
using System.Drawing;
public class Hello:Form {
public Hello() {
this.Paint += new PaintEventHandler(f1_paint);
}
private void f1_paint(object sender,PaintEventArgs e) {
Graphics g = e.Graphics;
g.DrawString("你好,C#!",new Font("Verdana",20),
new SolidBrush(Color.Tomato),40,40);
g.DrawRectangle(new Pen(Color.Pink,3),20,20,150,100);
}
public static void Main() {
Application.Run(new Hello());
}
}
using System;
using System.Windows.Forms;
using System.Drawing;
public class Hello:Form {
public Hello() {
this.Paint += new PaintEventHandler(f1_paint);
}
private void f1_paint(object sender,PaintEventArgs e) {
Graphics g = e.Graphics;
g.DrawString("你好,C#!",new Font("Verdana",20),
new SolidBrush(Color.Tomato),40,40);
g.DrawRectangle(new Pen(Color.Pink,3),20,20,150,100);
}
public static void Main() {
Application.Run(new Hello());
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询