private bool CanDraw() { if (!StageSize.Equals(_stage.Size)) { StageSize = _stage.Size; } return(!StageSize.IsZero()); }
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(); }
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(); }