• 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>
  • 相关阅读:
    Pytorch安装
    使用Inception-v3进行图像分类
    Tensorflow模型保存与载入
    LSTM用于MNIST手写数字图片分类
    卷积神经网络应用于MNIST数据集分类
    手工设计神经MNIST使分类精度达到98%以上
    关于优化器的选择
    手动设计神经网络进行MNIST分类
    Matplotlib学习
    Apiview使用方法
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434609.html
Copyright © 2020-2023  润新知