社区
C#
帖子详情
c# 中的Graphics 对象的ScaleTransform方法是什么作用呢?
ztqye
2006-06-02 10:55:43
c# 中的Graphics 对象的ScaleTransform方法是什么作用呢?
在进行变换前都要用这个方法,不用也能行?这个方法有什么作用,有什么好处呢?
...全文
1046
5
打赏
收藏
c# 中的Graphics 对象的ScaleTransform方法是什么作用呢?
c# 中的Graphics 对象的ScaleTransform方法是什么作用呢? 在进行变换前都要用这个方法,不用也能行?这个方法有什么作用,有什么好处呢?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
xvting
2006-06-05
打赏
举报
回复
效率!
Knight94
2006-06-02
打赏
举报
回复
你要干什么,ScaleTransform是用来放大或者缩小当前坐标系。
ztqye
2006-06-02
打赏
举报
回复
3q,不过为什么要设置呢这个因子呢>好象不设置也可以,
是不是设置了有什么好处?
效率???
xvting
2006-06-02
打赏
举报
回复
对图形的缩放和旋转操作可以表示为一个变换矩阵,这里ScaleTransform方式就是用来设置这个变换矩阵里和缩放有关的因子
图形和矩阵的关系可以参考 计算机图形学
矩阵的内容可以参考 线性代数
两个都是计算机系的课程
ztqye
2006-06-02
打赏
举报
回复
坐标系?
我看到好多图片方面的操作之前都要先用这个方法,这样的好处是什么呢?
全局变形和局部变形,图形填充,Paint
C#
源代码
Graphics
my
Graphics
=e.
Graphics
;
全局变形和局部变形,图形填充,Paint
C#
源代码
Graphics
my
Graphics
=e.
Graphics
; Rectangle myRectangle = new Rectangle(100, 100, 60, 60);
Graphics
Path my
Graphics
Path = new
Graphics
Path(); my
Graphics
Path.AddRectangle(myRectangle); SolidBrush mySolidBrush1=new SolidBrush(Color.Blue); my
Graphics
.FillPath(mySolidBrush1, my
Graphics
Path); Matrix myPathMatrix = new Matrix(); myPathMatrix.
Scale
(2, 1); myPathMatrix.Rotate(30, MatrixOrder.Append); my
Graphics
Path.
Transform
(myPathMatrix); SolidBrush mySolidBrush2=new SolidBrush(Color.Red); my
Graphics
.FillPath(mySolidBrush2, my
Graphics
Path); my
Graphics
.DrawEllipse(Pens.Blue, 0, 0, 100, 50); my
Graphics
.
Scale
Transform
(1, 0.5f); my
Graphics
.Translate
Transform
(50, 0, MatrixOrder.Append); my
Graphics
.Rotate
Transform
(30, MatrixOrder.Append); my
Graphics
.DrawEllipse(Pens.Red, 0, 0, 100, 50); VisualStudio2008创建
C#
Graphics
放大和旋转
//放大
Graphics
g = this.panel1.Create
Graphics
(); g.Clear(this.panel1.BackColor);
scale
=
scale
* 2; g.
Scale
Transform
(
scale
,
scale
); g.DrawRec
Graphics
.Page
Scale
Graphics
.
Scale
Transform
的区别
Graphics
.Page
Scale
此属性指定此
Graphics
的世界单位和页单位之间的比例值。
C#
Graphics
类的用法
Graphics
.Rotate
Transform
;
C#
Graphics
类详解
C#
Graphics
类详解 Brush 类 .NET Framework 4 定义用于填充图形形状(如矩形、椭圆、饼形、多边形和封闭路径)的内部的
对象
。 属于命名空间: System.Drawing 这是一个抽象基类,不能进行实例化,若要创建一个画笔
对象
,使用从 Brush 派生出的类,如 SolidBrush、TextureBrush 和 LinearGradientBrush。 So...
C#
110,533
社区成员
642,574
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章