using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace GDI_
{
public partial class Form1 : Form
{
private DrawTools dt;
private string _sType;
public Form1()
{
InitializeComponent();
}
private void pbImg_MouseDown(object sender,MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if(dt != null)
{
dt.startDraw = true;
dt.startPointF = new PointF(e.X, e.Y);
}
}
}
private void pbImg_MouseMove(object sender, MouseEventArgs e)
{
if (dt.startDraw)
{
switch (_sType)
{
default:dt.Draw(e, _sType);break;
}
}
}
private void pbImg_MouseUp(object sender, MouseEventArgs e)
{
GDI+ 绘制直线、矩形、椭圆
最新推荐文章于 2022-01-10 19:33:50 发布