菜鸟路过,怎么在有图片的picturebox里画一些符号啊。
下面这段程序为什么在只有一个picturebox的时候可以画出来,但如果把picturebox放到tabcontrol或者旁边在picturebox左边加一个gradview又画不出来了。而且能画出来的时候,调试的时候画出的符号(A)的位置老在变化? 求高手帮忙解答啊private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
pictureBox1.Refresh();
Pen mypen = new Pen(Color.Red, 6);//画笔
Point pShebei = new Point(0, 0);
Graphics g = pictureBox1.CreateGraphics();//画图
Brush redBrush = Brushes.Red;
Font songti = new Font("宋体", 14);
startpoint.X = MousePosition.X - 270;
startpoint.Y = MousePosition.Y - 28;
int realheng = MousePosition.X - 270;
int realshu = MousePosition.Y - 28;
g.DrawString("" + "A" + "", songti, redBrush, new Rectangle(new Point(startpoint.X - 4, startpoint.Y - 46), new Size(50, 50))); --------------------编程问答-------------------- 看不见应该是你的坐标不对吧,另外绘制代码最好放到onpaint中,你这样很容易就被刷新掉了
补充:.NET技术 , C#