Help!!!!! 如果设定g.PageUnit的单位是inch的话,如果2个点的坐标(10,20),(30,30),单位为英寸 请问如何在form上把这两点之间的线段画出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics g = e.Graphics; g.PageScale = 25.4f / 96; g.PageUnit = GraphicsUnit.Millimeter; Matrix matrix = new Matrix(1, 0, 0, -1, 0, 0); g.Transform = matrix; g.TranslateTransform(0, this.Height, System.Drawing.Drawing2D.MatrixOrder.Append); g.DrawLine(Pens.Red, 0, 0, 100, 100); g.DrawString("ABCDEFG", new Font("Verdana", 20, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.White, 0, 0); } protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); MessageBox.Show(e.X.ToString() + "--" + e.Y.ToString()); }对话框显示的还是以左上角为原点的坐标系,和我想象的不一样! 着急! protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); MessageBox.Show(e.X.ToString() + "--" + e.Y.ToString()); }我你的程序运行了一下,看到MessageBox显示的是你单击窗口时,你的鼠标所在的位置..但我不知道你要实现什么? 我要显示的是一个点在我定义的坐标系里面的坐标,而不是MessageBox.Show(e.X.ToString() + "--" + e.Y.ToString());显示的系统默认的坐标 打包html css image文件到exe中 新手问题C# 请教C++中的结构到c#的转换? 一个月的天数通过天数怎么算出星期几 遍歷目錄時提示無法訪問某一目錄 控件出现在线程过程中,为什么会出错? 如何使form窗体总在最前端显示~~~~~并使文字窗体中滚动实现!!!!!! 怎样用键盘向文本框中直接输入一个键盘上没有的ASCII字符? ******************关于XML与数据库的问题************************* 多个label,Text对齐问题 将Label控件的背影设为透明该怎样做啊! c#开发的三层架构,oracle第一次启动太慢
{
base.OnPaint(e);
Graphics g = e.Graphics;
g.PageScale = 25.4f / 96;
g.PageUnit = GraphicsUnit.Millimeter;
Matrix matrix = new Matrix(1, 0, 0, -1, 0, 0);
g.Transform = matrix;
g.TranslateTransform(0, this.Height, System.Drawing.Drawing2D.MatrixOrder.Append);
g.DrawLine(Pens.Red, 0, 0, 100, 100);
g.DrawString("ABCDEFG", new Font("Verdana", 20, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.White, 0, 0); }
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown(e);
MessageBox.Show(e.X.ToString() + "--" + e.Y.ToString());
}对话框显示的还是以左上角为原点的坐标系,和我想象的不一样! 着急!
{
base.OnMouseDown(e);
MessageBox.Show(e.X.ToString() + "--" + e.Y.ToString());
}
我你的程序运行了一下,看到MessageBox显示的是你单击窗口时,你的鼠标所在的位置..但我不知道你要实现什么?