每个矩形的角度不同 [英] Different angle to each rectangle

查看:109
本文介绍了每个矩形的角度不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只有几个矩形,并且我想在一次展览中绘制它们,但是要用不同的旋转角度
Graphics.RotateTransform对屏幕上的所有图形使用相同的角度,我想将它们分开,以使每个矩形将具有不同的角度.

i have few rectangles and i wand to draw them in one show but in different rotated angles
the Graphics.RotateTransform uses the same angle for all the drawing in the screen i want to separate them that each rectangle will have a different angle

推荐答案

)解决方法,您可以重复应用旋转变换.例如,以下代码(与MSDN上的RotateTransform示例略有不同[[a href ="http://msdn.microsoft.com/zh-cn/library/aa327663%28VS.71%29. aspx"target =" _ blank"title =" New Window> ^ ])绘制两个椭圆,它们以不同的角度旋转(分别为30°45°).
As simple (and naive) workaround, you may apply repeatedly the rotate transform. For instance, the following code (a little twist of the RotateTransform example on MSDN [^] ), draws two ellipses, rotated at different angles (namely 30° and 45°).
e.Graphics.RotateTransform(30.0F);
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);
e.Graphics.RotateTransform(15.0F);
e.Graphics.DrawEllipse(new Pen(Color.Blue, 3), 0, 0, 200, 80);


:)


这篇关于每个矩形的角度不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆