WPF - RotateTransform
這篇來測試一下旋轉的效果,旋轉的效果是將RotateTransForm設定給控制項的RenderTransForm屬性,執行的結果像下面這樣 下面我們就來看看測試的程式碼吧 Imports System.Windows Imports System.IO Imports System.Reflection Class Window1 Dim cv As Canvas Dim myT As Threading.DispatcherTimer Dim btnOther As New Button Dim rotatePoint As Double = 0 Private Sub Window1_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded cv = New Canvas Me.Content = cv For z As Integer = 0 To 9 Dim btn As New Button btn.Name = "btn_" & z ''設定旋轉的原點 btn.RenderTransformOrigin = New Point(0, 0) ''設定旋轉的角度 btn.RenderTransform = New RotateTransform(z * 36) btn.Content = "Button" & z & " Rotate=" & Format(z * 36, "000") btn.Background = Brushes.LightPink Canvas.SetLeft(btn, 150) Canvas.SetTop(btn, 150...