private Point startpoint;//全局变量鼠标按下点
private void pictureBox9_MouseDown(object sender, MouseEventArgs e)
{
Pen mypen = new Pen(Color.Red, 6);//画笔
Point pShebei = new Point(0, 0);
Graphics g = pictureBox9.CreateGraphics();//画图
Brush redBrush = Brushes.Red;
Font songti = new Font("宋体", 14); startpoint.X = MousePosition.X - 4 - 202;
startpoint.Y = MousePosition.Y - 28 - 45;
int realheng = MousePosition.X - - 4 - 202;
int realshu = MousePosition.Y - 28 - 45;
g.DrawString("" + "▼" + "", songti, redBrush, new Rectangle(new Point(startpoint.X - 4, startpoint.Y - 4), new Size(50, 50)));
private void pictureBox9_MouseDown(object sender, MouseEventArgs e)
{
Pen mypen = new Pen(Color.Red, 6);//画笔
Point pShebei = new Point(0, 0);
Graphics g = pictureBox9.CreateGraphics();//画图
Brush redBrush = Brushes.Red;
Font songti = new Font("宋体", 14); startpoint.X = MousePosition.X - 4 - 202;
startpoint.Y = MousePosition.Y - 28 - 45;
int realheng = MousePosition.X - - 4 - 202;
int realshu = MousePosition.Y - 28 - 45;
g.DrawString("" + "▼" + "", songti, redBrush, new Rectangle(new Point(startpoint.X - 4, startpoint.Y - 4), new Size(50, 50)));
private Point startpoint;//全局变量鼠标按下点
private Bitmap memoryBuffer;
private void 窗体_Load事件:
memoryBuffer=new Bitmap(pictureBox9.Width,pictureBox9.Height);private void pictureBox9_MouseDown(object sender, MouseEventArgs e)
{
Pen mypen = new Pen(Color.Red, 6);//画笔
Point pShebei = new Point(0, 0);
//Graphics g = pictureBox9.CreateGraphics();//画图
Graphics g=Graphcis.FromImage(memoryBuffer);
Brush redBrush = Brushes.Red;
Font songti = new Font("宋体", 14); startpoint.X = MousePosition.X - 4 - 202;
startpoint.Y = MousePosition.Y - 28 - 45;
int realheng = MousePosition.X - - 4 - 202;
int realshu = MousePosition.Y - 28 - 45;
g.DrawString("" + "▼" + "", songti, redBrush, new Rectangle(new Point(startpoint.X - 4, startpoint.Y - 4), new Size(50, 50))); pictureBox9.Image=memoryBuffer;
g.Dispose();
songti.Dispose();}
memoryBuffer=pictureBox9.Image;
....