silverlight 3D 投射

silverlight 3D 投射,第1张

概述  设计页: <UserControl x:Class="投射.MainPage"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.m

 

设计页:

<UserControl x:Class="投射.MainPage"
    xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="
http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="
http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWIDth="400">

    <GrID x:name="LayoutRoot" Background="White">
        <Rectangle Height="600" HorizontalAlignment="left"  name="rectangle1" stroke="Yellow"  strokeThickness="3" VerticalAlignment="top" WIDth="600">
            <Rectangle.Fill>
                <ImageBrush ImageSource="img/空姐.jpg" Stretch="None">
                    <ImageBrush.relativetransform >
                        <Rotatetransform CenterX="0.5" CenterY="0.5" Angle="-45"/>
                    </ImageBrush.relativetransform>
                </ImageBrush>
            </Rectangle.Fill>
            <Rectangle.Projection>
                <PlaneProjection x:name="pp3D"></PlaneProjection>
            </Rectangle.Projection>
        </Rectangle>
        <button WIDth="100" Content="上" Height="50" margin="110,400,100,100" name="btntop" Click="btntop_Click"></button>
        <button WIDth="100" Content="下" Height="50" margin="310,100" name="btnBotom" Click="btnBotom_Click"></button>
        <button WIDth="100" Content="左" Height="50" margin="110,480,100" name="btnleft" Click="btnleft_Click"></button>
        <button WIDth="100" Content="右" Height="50" margin="310,100" name="btnRight" Click="btnRight_Click"></button>
    </GrID>
</UserControl>

 

代码页:

using System;
using System.Collections.Generic;
using System.linq;
using System.Net;
using System.windows;
using System.windows.Controls;
using System.windows.documents;
using System.windows.input;
using System.windows.Media;
using System.windows.Media.Animation;
using System.windows.Shapes;

namespace 投射
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private voID btnleft_Click(object sender,RoutedEventArgs e)
        {
            pp3D.RotationY += 10;
          
        }

        private voID btnRight_Click(object sender,RoutedEventArgs e)
        {
            pp3D.RotationY -= 10;
           ;
        }

        private voID btntop_Click(object sender,RoutedEventArgs e)
        {
            pp3D.RotationX += 10;
        }

        private voID btnBotom_Click(object sender,RoutedEventArgs e)         {             pp3D.RotationX -= 10;         }     } }

总结

以上是内存溢出为你收集整理的silverlight 3D 投射全部内容,希望文章能够帮你解决silverlight 3D 投射所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1064998.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-26
下一篇 2022-05-26

发表评论

登录后才能评论

评论列表(0条)

保存