摘要: 一些人在论坛上询问关于不使用OnPaint方法或事件进行绘画的问题。 为什么要使用onpaint函数呢?主要原因是我们可以轻易地使用paint函数得到Graphics对象。实际上,不使用onpaint函数进行绘制是非常简单的。只需要在正在绘制的窗体中得到Graphics对象即可。 1 using S 阅读全文
posted @ 2022-08-01 22:28 chenlight 阅读(78) 评论(0) 推荐(0)
摘要: Move,Load,VisibleChanged 以及 Activated 事件在form显示之前就触发了。 阅读全文
posted @ 2022-07-31 23:20 chenlight 阅读(39) 评论(0) 推荐(0)
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Drawing; 6 using System.Windows.Forms; 7 阅读全文
posted @ 2022-07-31 11:03 chenlight 阅读(204) 评论(0) 推荐(0)
摘要: Form.Owner - Is the Form that "owns" this form. For example a modless Find/Replace dialog would be Owned by Notepad's main window. If you minimize the 阅读全文
posted @ 2022-07-30 16:07 chenlight 阅读(85) 评论(0) 推荐(0)
摘要: 在某行代码处右击,在弹出的右键菜单中选择“运行到光标处”,就可以在此行开始调试运行了! 阅读全文
posted @ 2022-07-27 23:21 chenlight 阅读(303) 评论(0) 推荐(0)
摘要: 在C#中,我们使用continue语句来跳过一个循环的当前迭代。当我们的程序遇到continue语句时,程序会移动到循环的末尾并执行测试条件(在for循环的情况是update语句)。 continue的语法是: continue; 在我们学习continue前,请先确保已学习过: for循环 whi 阅读全文
posted @ 2022-07-26 22:35 chenlight 阅读(181) 评论(0) 推荐(0)
摘要: 许多CAD应用程序提供在客户区域绘制旋转对象的功能。包含旋转功能的应用程序使用SetWorldTransform函数来设置适当的world-space到page-space的转换。这个函数接收一个指向包含了适当值的XFORM结构体的指针。XFORM的eM11、eM12、eM21和eM22成员分别指定 阅读全文
posted @ 2022-07-24 00:27 chenlight 阅读(167) 评论(1) 推荐(0)
摘要: 前言 .NET中2D图形变换已经被System.Drawing.Drawing2D命名空间的Matrix类大大简化了。在这篇文章中,我想和读者朋友分享一下Matrix类应用于2D图形变换的使用方法。 背景 Matrix类采用3行2列共计6个元素的排列组合;比如,默认构造函数构造的默认矩阵的值为(1, 阅读全文
posted @ 2022-07-20 22:33 chenlight 阅读(163) 评论(1) 推荐(0)
摘要: 现在我们改变一下变换顺序,顺序为Translate -> Rotate -> Scale,使用Append 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 阅读全文
posted @ 2022-07-19 23:00 chenlight 阅读(90) 评论(1) 推荐(0)
摘要: 坐标系不发生改变,坐标系上的某点A顺时针进行旋转一定的角度α,求旋转后点B的坐标; 阅读全文
posted @ 2022-07-17 21:29 chenlight 阅读(163) 评论(0) 推荐(0)