如何调试 GDI+在 c# 中?
我有一个用户控件,但它没有正确绘制,如何调试绘图? 如果设置断点,控件会被阻塞,无法立即看到绘图结果? 有什么想法吗?
i have a user control, and it's not drawn correctly, how to debug the drawing?
If i set break point, the control will get blocked, i can't see the drawing result instantly?
any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
更多
发布评论
评论(3)
您需要的是图形调试器可视化工具。
What you need is the Graphics Debugger visualizer.
最好使用多显示器设置来调试绘图活动,但如果您只有一台显示器,还有一些其他方法可以提供帮助。
下面的函数可以为您提供状态(需要 p/invoke)和来自 pinvoke.net 的签名。
GetKeyState Function() @ MSDN
pinvoke.net:GetKeyState (user32)
It's best to debug drawing activities with a multi-monitor setup, but there are a handful of other things that can help if you've only got one monitor.
Here's the function that can provide the state for you (requires p/invoke) and the signature from pinvoke.net.
GetKeyState Function() @ MSDN
pinvoke.net: GetKeyState (user32)
有一个免费的开源扩展支持 VS 2008-VS 2022:
KGy SOFT Image DebuggerVisualizers x64
它将允许您查看图形表示单步执行代码时的任何时候的对象(包括 Graphics 对象)。
There's a free and open source extension supporting VS 2008-VS 2022:
KGy SOFT Image DebuggerVisualizers x64
It will allow you to view the graphical representation of objects, including Graphics objects, at any point while stepping through your code.