如何在VB.net中旋转RectangleShape? [英] How to rotate a RectangleShape in VB.net?

查看:194
本文介绍了如何在VB.net中旋转RectangleShape?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB.net中可以旋转矩形吗?
代码是我的矩形形状

Is it possible to rotate a rectangle shape in VB.net? Code to my rectangle shape is this

baseDice.Parent = shapeContainer
baseDice.CornerRadius = 5
baseDice.Height = 50
baseDice.Width = 50
baseDice.BackColor = Color.Blue
baseDice.BackStyle = BackStyle.Opaque
baseDice.Left = 50
baseDice.Top = 50
baseDice.Name = "baseDice"

baseDice Microsoft.VisualBasic.PowerPacks.RecntangleShape

推荐答案

使用VB类矩阵,这是一个示例

Use the VB Class Matrix, here's an example

Dim myPen As New Pen(Color.Blue, 1)
Dim myPen2 As New Pen(Color.Red, 1)
e.Graphics.DrawRectangle(myPen, 150, 50, 200, 100)
Dim myMatrix As New Matrix()
myMatrix.Rotate(45, MatrixOrder.Append)
e.Graphics.Transform = myMatrix
e.Graphics.DrawRectangle(myPen2, 150, 50, 200, 100)

在矩阵中旋转角度和类型orm是(可以使用Append不断旋转一个角度)

In the Matrix.Rotate you give it the angle and what the type of transform is (you can use Append to constantly rotate by an angle)

e是PaintEventArgs类型

e is of PaintEventArgs type

这篇关于如何在VB.net中旋转RectangleShape?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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