Why does the following code return a transparent image?
The WHITE is transparent.
PdfFormatProvider provider = new PdfFormatProvider(file, FormatProviderSettings.ReadOnDemand);
RadFixedDocument document = provider.Import();
ThumbnailFactory factory = new ThumbnailFactory();
RadFixedPage page = document.Pages[0];
System.Windows.Media.ImageSource source = factory.CreateThumbnail(page, page.Size);
var image = (BitmapSource)source;
BitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(image));
using (var ms = new MemoryStream())
{
encoder.Save(ms);
ms.Position = 0;
return ms;
}
Thankx, Harry
The WHITE is transparent.
PdfFormatProvider provider = new PdfFormatProvider(file, FormatProviderSettings.ReadOnDemand);
RadFixedDocument document = provider.Import();
ThumbnailFactory factory = new ThumbnailFactory();
RadFixedPage page = document.Pages[0];
System.Windows.Media.ImageSource source = factory.CreateThumbnail(page, page.Size);
var image = (BitmapSource)source;
BitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(image));
using (var ms = new MemoryStream())
{
encoder.Save(ms);
ms.Position = 0;
return ms;
}
Thankx, Harry