2016-01-12 58 views
0

我正在使用SyncFusion創建PDF並想知道如何將一個數組字節轉換爲一個在XAML/C#中的畫布上繪製的簽名到PdfBitmap。所以我可以將簽名添加到PDF文檔中。如何將byte []轉換爲PdfBitmap?

//requires stream of a file, but I only have a byte array 
PdfBitmap image = new PdfBitmap(stream); 
graphics.DrawImage(image, 0, 0); 

回答

2

你可以在@Patrick McDonald評論中找到你的答案。但是,爲了進一步參考,這裏它是你需要的:

Stream stream = new MemoryStream(byteArray); 
PdfBitmap image = new PdfBitmap(stream); 
graphics.DrawImage(image, 0, 0);