在屏幕上画图的C#实现代码
2009-12-25 08:23
302 查看
DllImport所在的名字空间 using System.Runtime.InteropServices; [DllImport("User32.dll")] public extern static System.IntPtr GetDC(System.IntPtr hWnd); private void button19_Click(object sender, EventArgs e) { System.IntPtr DesktopHandle = GetDC(System.IntPtr.Zero); Graphics g = Graphics.FromHdc(DesktopHandle); g.DrawRectangle(new Pen(Color.Red),new Rectangle(10,10,100,100)); } |
相关文章推荐
- 使用C#实现在屏幕上画图效果的代码实例
- 用MATLAB实现屏幕截屏的代码
- 代码实现屏幕切换
- 实现HMTL网页的全屏幕显示或模态显示 (JS代码)
- JQuery获取当前屏幕的高度宽度的实现代码
- js使用html2canvas实现屏幕截取的示例代码
- 【代码练习8】UDP协议实现局域网屏幕广播功能
- 代码实现屏幕滚动!
- NFA-DFA(c++实现代码c#实现画图)
- JAVA功能代码《6》----用Java实现屏幕截图
- JS 获取浏览器和屏幕宽高等信息的实现思路及代码
- MapView上长按屏幕添加大头针代码实现
- TabHost 默认布局,以及将TAB移到屏幕底部, 代码实现
- JS实现双击屏幕滚动效果代码
- 基于visual c++之windows核心编程代码分析(40)实现屏幕截取
- TabHost 默认布局,以及将TAB移到屏幕底部, 代码实现
- iOS 强制旋转屏幕 的代码实现
- JS获取屏幕,浏览器窗口大小,网页高度宽度(实现代码)
- Android ImageView图片代码实现按屏幕宽度等比例缩放