private void canvasControl_CreateResources(CanvasControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { CreateSizeDependentResources(); if (ThumbnailGenerator.IsDrawingThumbnail) { args.TrackAsyncAction(LoadThumbnailResources(sender).AsAsyncAction()); } needToCreateSizeDepdendentResources = false; if (args.Reason != CanvasCreateResourcesReason.FirstTime) { needsInkSurfaceValidation = true; } }
private void Canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { Debug.WriteLine("CreateResource"); if (blurEffect != null) { blurEffect.Dispose(); } if (this.AllowBlur == true) { Debug.WriteLine("CreateResource new GaussianBlurEffect"); blurEffect = new GaussianBlurEffect(); } this.CreateResources?.Invoke(sender, args); }
private void canvas_CreateResources(CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { if (args.Reason == CanvasCreateResourcesReason.DpiChanged) { return; } const float defaultDpi = 96; currentSurface = new CanvasRenderTarget(sender, simulationW, simulationH, defaultDpi); nextSurface = new CanvasRenderTarget(sender, simulationW, simulationH, defaultDpi); transformEffect = new Transform2DEffect { Source = currentSurface, InterpolationMode = CanvasImageInterpolation.NearestNeighbor, }; args.TrackAsyncAction(CreateResourcesAsync(sender).AsAsyncAction()); }
private void CanvasAnimatedControl_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(CreateResourcesAsync(sender, args).AsAsyncAction()); }
void ICanvasBitmapHolder.CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { args.TrackAsyncAction(CreateResourcesAsync(sender).AsAsyncAction()); }
protected void CanvasAnimatedControl_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args) { sender.TargetElapsedTime = TimeSpan.FromMilliseconds(1000 / 30); args.TrackAsyncAction(LoadResources(sender).AsAsyncAction()); }