public async void Initialize() { _tempBitmapFile = await _page.GenerateThumbnail(); Uri uri = new Uri(_tempBitmapFile.FileName, UriKind.Absolute); var image = new BitmapImage(); image.BeginInit(); image.CacheOption = BitmapCacheOption.OnLoad; image.UriSource = uri; image.EndInit(); TransformedBitmap transformed = new TransformedBitmap(image, new RotateTransform(0)); Image.Value = transformed; IsGeneratingImage.Value = false; }
private async Task<TemporaryBitmapFile> CreateRasterFile(Dimensions scaledSize, int dpi) { var tempFile = new TemporaryBitmapFile("png"); await _pdfRendering.GenerateOutput(_source.File, tempFile.FileName, CreateSetting(scaledSize, dpi)); return tempFile; }