I have a WPF pdf viewer code. I'm trying to convert it into UWP. To render the pages of a pdf, WPF uses System.Windows.Media.Imaging.WriteableBitmap. UWP compatible Windows.UI.Xaml.Media.Imaging.WriteableBitmap doesn't contain all the functionalities as in wpf compatible package. I can't find functions to replace the below methods.
WriteableBitmap renderTarget;
var bitmapFormat = GetBitmapFormat(renderTarget.Format);
renderTarget.Lock();
renderTarget.AddDirtyRect(new Int32Rect(rectDest.left, rectDest.top, rectDest.width, rectDest.height));
renderTarget.Unlock();
Does anyone know a workaround or new package which I can use to replace those methods( Format, Lock, AddDirtyRect, Unlock)?
The above package also should have a constructor that accepts following parameters.
WriteableBitmap(int pixelWidth, int pixelHeight, double dpiX, double dpiY, PixelFormat pixelFormat, BitmapPalette palette);
Additionally, Need to replace System.Windows.Media.PixelFormats and use a UWP compatible one. UWP compatible Windows.Graphics.Imaging.BitmapPixelFormat does not contain all pixel formats such as Bgra32, Bgr32, Bgr24).