C# 绘图

havedream_one 2013-03-18 01:58:53
g.DrawArc(p, 10.5f, 10.4f, 100.5f, 200.3f, 0, 90);
g.DrawArc(p, (float)p0.X ,(float)p0.Y ,(float)(p1.X-p0.X ) ,(float) (p1.Y-p0.Y ) ,0f,45f);
上面的代码有区别吗 p0和p1是决定矩形的
第一行代码可执行 而第二行代码会出现异常
...全文
129 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lin1232147 2013-03-19
  • 打赏
  • 举报
回复
会不会是p0.X p0.Y p1.X p1.Y 定义时候有初始值么? 如果没有你后面操作的时候赋值失败的话,那就没值了、 希望对你有帮助.
keith_cheung 2013-03-18
  • 打赏
  • 举报
回复
不要手动来弄了,建议你直接用 VS2010 及以上的 Chart 控件,这样方便!
gxingmin 2013-03-18
  • 打赏
  • 举报
回复
是不是p1.X-p0.X=0或p1.Y-p0.Y=0了?
havedream_one 2013-03-18
  • 打赏
  • 举报
回复
异常为: 未处理 System.ArgumentException Message="参数无效。" Source="System.Drawing" StackTrace: 在 System.Drawing.Graphics.CheckErrorStatus(Int32 status) 在 System.Drawing.Graphics.DrawArc(Pen pen, Single x, Single y, Single width, Single height, Single startAngle, Single sweepAngle) 在 Draw.Form1.tabPage2_MouseMove(Object sender, MouseEventArgs e) 位置 D:\C#程序设计\图形\基本图形类\Draw\Draw\Form1.cs:行号 76 在 System.Windows.Forms.Control.WmMouseMove(Message& m) 在 System.Windows.Forms.Control.WndProc(Message& m) 在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) 在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 在 Draw.Program.Main() 位置 D:\C#程序设计\图形\基本图形类\Draw\Draw\Program.cs:行号 18 在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart() InnerException:

110,529

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧