zoukankan      html  css  js  c++  java
  • WPF RenderTransform的使用

    呈现变形的元素并没有改变位置,只是呈现在不同的位置而已,所以动画要用呈现变形

    好处:为了效率,如果改变位置的话,需要重新测量,布局

    <Window x:Class="wpf180709.MainWindow"

            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="509.067" Width="569.776">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Button Width="80" Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" Content="Hello">
                <Button.RenderTransform>
                    <TransformGroup>
                        <RotateTransform CenterX="40" CenterY="40" Angle="45"></RotateTransform>
                        <TranslateTransform X="300" Y="300"></TranslateTransform>
                    </TransformGroup>
                </Button.RenderTransform>

            </Button>
        </Grid>
    </Window>
  • 相关阅读:
    学习中的坑
    友链
    CF1131E String Multiplication 题解
    CF438E The Child and Binary Tree 题解
    [WC2005]友好的生物题解
    [IOI2016]shortcut 题解
    CF911F [Tree Destruction] 题解
    状压dp技巧之轮廓线 hdu1400/poj2411acwing291 蒙德里安的梦想
    TG-WC2021 笔记
    拯救世界2题解
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434609.html
Copyright © 2011-2022 走看看