private void OutputImageCanvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasVirtualControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { if (InputImageStream != null) { args.TrackAsyncAction(LoadOutputVirtualBitmap().AsAsyncAction()); } }
private void ImageVirtualControl_CreateResources(CanvasVirtualControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { if (imageStream != null) { args.TrackAsyncAction(LoadVirtualBitmap().AsAsyncAction()); } }
private void Canvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { //创建径向渐变画笔的实例;中心将是透明的, 极端不透明的黑色 canvasRadialGradientBrush = new CanvasRadialGradientBrush(sender, Colors.Transparent, Colors.Black); //加载要绘制的图像。 args.TrackAsyncAction(Task.Run(async() => { image = await CanvasBitmap.LoadAsync(sender, new Uri("ms-appx:///wallhaven-766453.jpg")); }).AsAsyncAction()); }
private void Canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { for (int i = 0; i < 6; i++) { Items.Add(new Uri($"ms-appx:///Assets/Images/loadinganim{i}.png")); } args.TrackAsyncAction(Canvas_CreateResourcesAsync(sender).AsAsyncAction()); }
private void canvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { CreateSizeDependentResources(); if (ThumbnailGenerator.IsDrawingThumbnail) { args.TrackAsyncAction(LoadThumbnailResources(sender).AsAsyncAction()); } }
private void GameCanvas_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(CreateResourcesAsync(sender).AsAsyncAction()); width = GameCanvas.ActualWidth; height = GameCanvas.ActualHeight; shipWidth = (int)(width / 2 - 150); shipHeight = (int)(height - 425); }
private void Canvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { // Create instance of radial gradient brush; the center will be transparent and the extremes opaque black. radialBrush = new CanvasRadialGradientBrush(sender, Colors.Transparent, Colors.Black); // Load image to draw. args.TrackAsyncAction(Task.Run(async() => { image = await CanvasBitmap.LoadAsync(sender, new Uri("ms-appx:///SpotlightImage.png")); }).AsAsyncAction()); }
private void Canvas1_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { if (mainCharacter == null) { mainCharacter = new GameCharacter(Canvas1); } //Grass shapes.Add(new Rect(0, Canvas1.ActualHeight - 75, Canvas1.ActualWidth, 75), Colors.Green); for (int i = 0; i < 5; i++) { shapes.Add(new Rect(100 + (i * 150), Canvas1.ActualHeight - (150 + i * 80), 140, 10), Colors.Brown); } shapes.Add(new Rect(1000, 300, 140, 10), Colors.Green); args.TrackAsyncAction(mainCharacter.CreateResources(sender).AsAsyncAction()); }
/// <summary> /// Creates shared resources for Win2D rendering /// </summary> private void PersistentHolderCanvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(RenderService.CreateResourcesAsync(sender).AsAsyncAction()); }
// Adapted from https://microsoft.github.io/Win2D/html/T_Microsoft_Graphics_Canvas_UI_Xaml_CanvasControl.htm private void GameCanvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { // Calls CreateResourcesAsync Task and ensures could will not execute until the task completes args.TrackAsyncAction(CreateResourcesAsync(sender).AsAsyncAction()); }
private void OnCreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { // Creates Resources once // Load Images args.TrackAsyncAction(LoadResourcesAsync(sender).AsAsyncAction()); }
private void canvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(LoadImages(sender.Device).AsAsyncAction()); }
private void BlurCanvas_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(ReflashBackground(sender, CurrentTrack?.PictureUrl).AsAsyncAction()); }
private void CreateCanvasResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(CreateInitialResourcesAsync(sender).AsAsyncAction()); }
private void CanvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(PreparePage(sender).AsAsyncAction()); }
private void Canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(CreateResources(sender).AsAsyncAction()); }
private void Canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { init = false; args.TrackAsyncAction(Engine.LoadResources(this).AsAsyncAction()); }