本文整理匯總了C#中NPOI.XWPF.UserModel.XWPFDocument.AddPictureData方法的典型用法代碼示例。如果您正苦於以下問題:C# XWPFDocument.AddPictureData方法的具體用法?C# XWPFDocument.AddPictureData怎麽用?C# XWPFDocument.AddPictureData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NPOI.XWPF.UserModel.XWPFDocument
的用法示例。
在下文中一共展示了XWPFDocument.AddPictureData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestAllPictureFormats
public void TestAllPictureFormats()
{
XWPFDocument doc = new XWPFDocument();
doc.AddPictureData(new byte[10], (int)PictureType.EMF);
doc.AddPictureData(new byte[11], (int)PictureType.WMF);
doc.AddPictureData(new byte[12], (int)PictureType.PICT);
doc.AddPictureData(new byte[13], (int)PictureType.JPEG);
doc.AddPictureData(new byte[14], (int)PictureType.PNG);
doc.AddPictureData(new byte[15], (int)PictureType.DIB);
doc.AddPictureData(new byte[16], (int)PictureType.GIF);
doc.AddPictureData(new byte[17], (int)PictureType.TIFF);
doc.AddPictureData(new byte[18], (int)PictureType.EPS);
doc.AddPictureData(new byte[19], (int)PictureType.BMP);
doc.AddPictureData(new byte[20], (int)PictureType.WPG);
Assert.AreEqual(11, doc.AllPictures.Count);
doc = XWPFTestDataSamples.WriteOutAndReadBack(doc);
Assert.AreEqual(11, doc.AllPictures.Count);
}