当前位置: 首页>>代码示例>>C#>>正文


C# Compositor.CreateTargetForCurrentView方法代码示例

本文整理汇总了C#中Compositor.CreateTargetForCurrentView方法的典型用法代码示例。如果您正苦于以下问题:C# Compositor.CreateTargetForCurrentView方法的具体用法?C# Compositor.CreateTargetForCurrentView怎么用?C# Compositor.CreateTargetForCurrentView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Compositor的用法示例。


在下文中一共展示了Compositor.CreateTargetForCurrentView方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitNewComposition

        void InitNewComposition()
        {
            _compositor = new Compositor();

            _root = _compositor.CreateContainerVisual();

            _compositionTarget = _compositor.CreateTargetForCurrentView();
            _compositionTarget.Root = _root;

            CreateChildElement();
        }
开发者ID:RudyChen,项目名称:composition,代码行数:11,代码来源:CompositionImageSample.cs

示例2: InitNewComposition

        void InitNewComposition()
        {
            //
            // Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
            // the CoreWindow.
            //

            _compositor = new Compositor();
            _root = _compositor.CreateContainerVisual();
            _target = _compositor.CreateTargetForCurrentView();
            _target.Root = _root;
            Mask();
        }
开发者ID:RudyChen,项目名称:composition,代码行数:13,代码来源:AlphaMask.cs

示例3: InitNewComposition

        //------------------------------------------------------------------------------
        //
        // VisualProperties.InitNewComposition
        //
        // This method is called by SetWindow(), where we initialize Composition after
        // the CoreWindow has been created.
        //
        //------------------------------------------------------------------------------

        void InitNewComposition()
        {
            //
            // Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
            // the CoreWindow.
            //

            _compositor = new Compositor();
            _root = _compositor.CreateContainerVisual();
            _target = _compositor.CreateTargetForCurrentView();
            _target.Root = _root;
            _imageFactory = CompositionImageFactory.CreateCompositionImageFactory(_compositor);
            TintedBrush();
        }
开发者ID:RudyChen,项目名称:composition,代码行数:23,代码来源:ColorSource+and+Blend.cs

示例4: InitNewComposition

        //------------------------------------------------------------------------------
        //
        // VisualProperties.InitNewComposition
        //
        // This method is called by SetWindow(), where we initialize Composition after
        // the CoreWindow has been created.
        //
        //------------------------------------------------------------------------------

        void InitNewComposition()
        {
            //
            // Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
            // the CoreWindow.
            //

            _compositor = new Compositor();

            _root = _compositor.CreateContainerVisual();



            _compositionTarget = _compositor.CreateTargetForCurrentView();
            _compositionTarget.Root = _root;

            //
            // Create a few visuals for our window
            //
            for (int index = 0; index < 20; index++)
            {
                _root.Children.InsertAtTop(CreateChildElement());
            }
        }
开发者ID:RudyChen,项目名称:composition,代码行数:33,代码来源:VisualProperties.cs

示例5: InitializeCompositor

        private void InitializeCompositor()
        {
            //Create Compositor, Target, RootVisual, Configure Target
            _compositor = new Compositor();

            _target = _compositor.CreateTargetForCurrentView();

            _rootVisual = _compositor.CreateContainerVisual();

            _target.Root = _rootVisual;
        }
开发者ID:clarkezone,项目名称:BUILD2015-Talk-2-672,代码行数:11,代码来源:CompositionApp.cs

示例6: InitNewComposition

        //------------------------------------------------------------------------------
        //
        // VisualProperties.InitNewComposition
        //
        // This method is called by SetWindow(), where we initialize Composition after
        // the CoreWindow has been created.
        //
        //------------------------------------------------------------------------------
        void InitNewComposition()
        {
            //
            // Set up Windows.UI.Composition Compositor, root ContainerVisual, and associate with
            // the CoreWindow.
            //

            _compositor = new Compositor();

            _root = _compositor.CreateContainerVisual();

            #region temp dpi fix
            //temporary: manually correct for DPI
            float dpiScaleFactor = (float)Windows.Graphics.Display.DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
            _root.Scale = new Vector3(dpiScaleFactor, dpiScaleFactor, 1.0f);
            #endregion

            _compositionTarget = _compositor.CreateTargetForCurrentView();
            _compositionTarget.Root = _root;

            //
            // Create a few visuals for our window
            //
            for (int index = 0; index < 20; index++)
            {
                _root.Children.InsertAtTop(CreateChildElement());
            }
        }
开发者ID:678uhb,项目名称:composition,代码行数:36,代码来源:VisualProperties.cs

示例7: SetWindow

        public async void SetWindow(CoreWindow window)
        {
            this.window = window;

            if (!Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 2))
            {
                var dialog = new MessageDialog("This version of Windows does not support the Composition APIs.");
                await dialog.ShowAsync();
                CoreApplication.Exit();
                return;
            }

            window.PointerPressed += Window_PointerPressed;

            CoreApplication.Suspending += CoreApplication_Suspending;
            DisplayInformation.DisplayContentsInvalidated += DisplayInformation_DisplayContentsInvalidated;

            compositor = new Compositor();

            CreateDevice();

            drawingSurfaceRenderer = new DrawingSurfaceRenderer(compositor, compositionGraphicsDevice);

            swapChainRenderer = new SwapChainRenderer(compositor);
            swapChainRenderer.SetDevice(device, new Size(window.Bounds.Width, window.Bounds.Height));

            drawingSurfaceRenderer.Visual.Offset = new Vector3(-drawingSurfaceRenderer.Size.ToVector2(), 0);
            swapChainRenderer.Visual.Offset = new Vector3((float)window.Bounds.Width, (float)window.Bounds.Height, 0);
            
            var rootVisual = compositor.CreateContainerVisual();
            rootVisual.Children.InsertAtTop(swapChainRenderer.Visual);
            rootVisual.Children.InsertAtTop(drawingSurfaceRenderer.Visual);

            compositor.CreateTargetForCurrentView().Root = rootVisual;

            var ignoredTask = UpdateVisualsLoop();
        }
开发者ID:fengweijp,项目名称:Win2D,代码行数:37,代码来源:App.cs


注:本文中的Compositor.CreateTargetForCurrentView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。