本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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());
}
}
示例5: InitializeCompositor
private void InitializeCompositor()
{
//Create Compositor, Target, RootVisual, Configure Target
_compositor = new Compositor();
_target = _compositor.CreateTargetForCurrentView();
_rootVisual = _compositor.CreateContainerVisual();
_target.Root = _rootVisual;
}
示例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());
}
}
示例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();
}