Ejemplo n.º 1
0
        private bool CanDraw()
        {
            if (!StageSize.Equals(_stage.Size))
            {
                StageSize = _stage.Size;
            }

            return(!StageSize.IsZero());
        }
Ejemplo n.º 2
0
        private void FitBackground()
        {
            if (StageSize.IsZero())
            {
                return;
            }

            if (BgBmp == null)
            {
                ReloadBackground();
                return;
            }

            (StageRect, BgFillRect) = ImageUtils.FitImage(StageSize, BgBmp);
            vh = 0.5f * (BgBmp.SizeInPixels.Height - ( float )BgFillRect.Height);

            ActivateBgDraw();
        }
Ejemplo n.º 3
0
        private async void ReloadBackground()
        {
            if (ResCreator == null || StageSize.IsZero())
            {
                return;
            }

            if (BackgroundUri == null || BackgroundUri.Scheme == "ms-appx")
            {
                BgBmp = new RandomStripe(Seed).DrawBitmap(ResCreator, ( int )LayoutSettings.DisplayWidth, ( int )LayoutSettings.DisplayHeight);
            }
            else
            {
                BgBmp = await CanvasBitmap.LoadAsync(ResCreator, BackgroundUri);
            }

            FitBackground();
        }