本文整理汇总了C#中System.Windows.Xps.Packaging.XpsImageType枚举的典型用法代码示例。如果您正苦于以下问题:C# XpsImageType枚举的具体用法?C# XpsImageType怎么用?C# XpsImageType使用的例子?那么恭喜您, 这里精选的枚举代码示例或许可以为您提供帮助。
在下文中一共展示了XpsImageType枚举的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Create
// ---------------------------- Create() ------------------------------
/// <summary>
/// Creates an XpsDocument using the Xps.Packaging APIs.</summary>
/// <param name="xpsDocument">
/// The XpsDocument to create.</param>
/// <remarks>
/// The Xps.Packaging APIs are used to create the DocumentSequence,
/// FixedDocument, and FixedPage "PackageParts" of an XpsDocument.
/// The applicationt is responsible for using the XmlWriter to
/// serialize the page markup and for supplying the streams for any
/// font or image resources.</remarks>
public void Create(XpsDocument xpsDocument)
{
// Create the document sequence
IXpsFixedDocumentSequenceWriter docSeqWriter =
xpsDocument.AddFixedDocumentSequence();
// Create the document
IXpsFixedDocumentWriter docWriter = docSeqWriter.AddFixedDocument();
// Create the Page
IXpsFixedPageWriter pageWriter = docWriter.AddFixedPage();
// Get the XmlWriter
XmlWriter xmlWriter = pageWriter.XmlWriter;
// Write the mark up according the XPS Specifications
BeginFixedPage(xmlWriter);
AddGlyphRun(pageWriter, xmlWriter,
"This is a photo of the famous Notre Dame in Paris",
16, 50, 50, @"C:\Windows\fonts\arial.ttf");
AddImage(pageWriter, xmlWriter,
"ParisNotreDame.jpg", XpsImageType.JpegImageType,
100, 100, 600, 1100 );
// End the page.
EndFixedPage( xmlWriter );
// Close the page, document, and document sequence.
pageWriter.Commit();
docWriter.Commit();
docSeqWriter.Commit();
_fontDictionary.Clear();
}// end:Create()
开发者ID:.NET开发者,项目名称:System.Windows.Xps.Packaging,代码行数:45,代码来源:XpsImageType
注:本文中的System.Windows.Xps.Packaging.XpsImageType枚举示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论