91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 20.25M
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2020-12-26
  • 語言: C#
  • 標簽: wpf??示例??旋轉??

資源簡介

演示分割旋轉、組件旋轉方式。
1、分割旋轉如需對組件窗體進行分割,可以將其轉換為圖像進行旋轉,完畢后再顯示組件窗體;
轉為圖像可修改如下代碼:可以自行更改換為BitmapSource
private void SaveControlImage(FrameworkElement control, string filename)
        {
            Rect rect = VisualTreeHelper.GetDescendantBounds(control);
            DrawingVisual dv = new DrawingVisual();
            using (DrawingContext ctx = dv.RenderOpen())
            {
                VisualBrush brush = new VisualBrush(control);
                ctx.DrawRectangle(brush, null, new Rect(rect.Size));
            }
            int width = (int)control.ActualWidth;
            int height = (int)control.ActualHeight;
            RenderTargetBitmap rtb = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Pbgra32);
            rtb.Render(dv);
            PngBitmapEncoder encoder = new PngBitmapEncoder();
            encoder.Frames.Add(BitmapFrame.Create(rtb));
            using (FileStream fs = new FileStream(filename,FileMode.Create, FileAccess.Write, FileShare.None))
            {
                encoder.Save(fs);
            }
        }
這里只演示圖像。

2、組件旋轉為整體旋轉,可當做窗體,加入其它組件。旋轉如果加入陰影(DropShadowEffect)動畫將不流暢出現抖動,這里通過圖像方式制作陰影(CustomShadow.cs),
未使用DropShadowEffect方式,動畫較為流暢。

3、設置幀率:見App.xaml、App.cs文件
private void Application_Startup(object sender, StartupEventArgs e)
        {
            Timeline.DesiredFrameRateProperty.OverrideMetadata(
                typeof(Timeline),
                new FrameworkPropertyMetadata { DefaultValue = null }
                );
        }
可將null設置為60、90、100等。
畫面流暢時看不出來,將null設置為5、10等較小值可見其作用。


4、動畫按照對象原始大小顯示方法,代碼里查看


viewport3D = new Viewport3D();

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Configuration;
using?System.Data;
using?System.Linq;
using?System.Threading.Tasks;
using?System.Windows;
using?System.Windows.Media.Animation;

namespace?demo_E
{
????///?
????///?App.xaml?的交互邏輯
????///?

????public?partial?class?App?:?Application
????{
????????private?void?Application_Startup(object?sender?StartupEventArgs?e)
????????{
????????????Timeline.DesiredframeRateProperty.Overridemetadata(
????????????????typeof(Timeline)
????????????????new?frameworkPropertymetadata?{?DefaultValue?=?null?}
????????????????);
????????}
????}
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

????..A..H.?????66048??2019-09-27?21:34??demo_G\.vs\demo_G\v16\.suo

?????文件??????????0??2019-09-27?19:50??demo_G\.vs\demo_G\v16\Server\sqlite3\db.lock

?????文件?????720896??2019-09-27?21:34??demo_G\.vs\demo_G\v16\Server\sqlite3\storage.ide

?????文件????????189??2019-09-27?19:50??demo_G\demo_G\App.config

?????文件????????425??2019-09-27?19:51??demo_G\demo_G\App.xaml

?????文件????????662??2019-09-27?19:51??demo_G\demo_G\App.xaml.cs

?????文件????1077248??2019-09-27?21:34??demo_G\demo_G\bin\Debug\demo_G.exe

?????文件????????189??2019-09-27?19:50??demo_G\demo_G\bin\Debug\demo_G.exe.config

?????文件??????71168??2019-09-27?21:34??demo_G\demo_G\bin\Debug\demo_G.pdb

?????文件???????5231??2019-09-27?19:54??demo_G\demo_G\demo_G.csproj

?????文件???????3421??2019-09-26?19:51??demo_G\demo_G\Effect\CustomShadow.cs

?????文件???????1368??2019-09-26?20:30??demo_G\demo_G\Effect\effectHelper.cs

?????文件?????????75??2019-09-27?21:34??demo_G\demo_G\Effect\Rotary\Container.cs

?????文件????????579??2019-09-22?09:37??demo_G\demo_G\Effect\Rotary\ContainerUtils.cs

?????文件????????377??2019-09-26?11:03??demo_G\demo_G\Effect\Rotary\PlaneRotary.xaml

?????文件???????7375??2019-09-26?20:53??demo_G\demo_G\Effect\Rotary\PlaneRotary.xaml.cs

?????文件???????1056??2019-09-24?20:29??demo_G\demo_G\Effect\Rotary\RotaryElement.cs

?????文件????????451??2019-09-24?20:25??demo_G\demo_G\Effect\Rotary\Rotate3DContainer.xaml

?????文件??????11554??2019-09-24?20:28??demo_G\demo_G\Effect\Rotary\Rotate3DContainer.xaml.cs

?????文件??????17145??2019-09-24?08:30??demo_G\demo_G\Images\shadow.png

?????文件?????406047??2019-09-27?18:40??demo_G\demo_G\Images\za.png

?????文件?????626012??2019-09-27?18:41??demo_G\demo_G\Images\zb.png

?????文件????????695??2019-09-27?19:56??demo_G\demo_G\MainWindow.xaml

?????文件???????3055??2019-09-27?20:21??demo_G\demo_G\MainWindow.xaml.cs

?????文件???????2559??2019-09-27?21:34??demo_G\demo_G\obj\Debug\App.g.cs

?????文件???????2559??2019-09-27?21:34??demo_G\demo_G\obj\Debug\App.g.i.cs

?????文件?????????42??2019-09-27?21:34??demo_G\demo_G\obj\Debug\demo_G.csproj.CoreCompileInputs.cache

?????文件???????1018??2019-09-27?21:34??demo_G\demo_G\obj\Debug\demo_G.csproj.FileListAbsolute.txt

?????文件????????954??2019-09-27?21:34??demo_G\demo_G\obj\Debug\demo_G.csproj.GenerateResource.cache

?????文件????1077248??2019-09-27?21:34??demo_G\demo_G\obj\Debug\demo_G.exe

............此處省略351個文件信息

評論

共有 條評論