How to get a Bitmap source from bitmap handle which is created from Pdfium.FPDFBitmap_Create method.

185 views
Skip to first unread message

Kathiravan E

unread,
Mar 22, 2018, 6:09:27 AM3/22/18
to pdfium
The application was crashed when i tried to create a bitmap source from bitmap handle by using the below code snippet,

     IntPtr bitmapHandler = PdfiumViewer.FPDFBitmap_Create(Width, Height,0);
     BitmapSource bs = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bitmapHandler ,
                       IntPtr.Zero, Int32Rect.Empty,
                       System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());



Exception details:

Exception thrown: 'System.Runtime.InteropServices.COMException' in PresentationCore.dll

Additional information: Windows Codecs received an error from the Win32 system. (Exception from HRESULT: 0x88982F94) 

Can any one please suggest how to get the bitmap source from bitmap handler which is created from FPDFBitmap_Create.

Regards,
KathiravanE

Dan Sinclair

unread,
Mar 22, 2018, 9:47:58 AM3/22/18
to kathir...@gmail.com, pdfium
This looks like it's related to the PdfiumViewer code, please ask on the appropriate PdfiumViewer forums.

Thanks,
dan



--
You received this message because you are subscribed to the Google Groups "pdfium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfium+un...@googlegroups.com.
To post to this group, send email to pdf...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfium/c2a24b09-ab1e-4f59-85d0-21f0d28039fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages