예제 #1
0
        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;
            }
        }
예제 #2
0
파일: SlateView.cs 프로젝트: samoteph/Sugoi
        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);
        }
예제 #3
0
        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());
        }
예제 #4
0
 private void CanvasAnimatedControl_CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender, Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
 {
     args.TrackAsyncAction(CreateResourcesAsync(sender, args).AsAsyncAction());
 }
예제 #5
0
 void ICanvasBitmapHolder.CreateResources(Microsoft.Graphics.Canvas.UI.Xaml.CanvasAnimatedControl sender,
                                          Microsoft.Graphics.Canvas.UI.CanvasCreateResourcesEventArgs args)
 {
     args.TrackAsyncAction(CreateResourcesAsync(sender).AsAsyncAction());
 }
예제 #6
0
 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());
 }