本文整理匯總了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()