示例#1
0
		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;
		}
示例#2
0
文件: PdfPage.cs 项目: baluubas/Magic
		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;
		}