XpsImageType Enumeration
.NET Framework 3.0
Specifies graphical formats for images that can be included in an XpsDocument.
Namespace: System.Windows.Xps.Packaging
Assembly: ReachFramework (in reachframework.dll)
Assembly: ReachFramework (in reachframework.dll)
The following example shows how to use this enumeration when you add images to an XML Paper Specification (XPS) document.
// ---------------------------- 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()
For the complete sample, see Read-Write-Sign an XPS Document Sample.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Reference
System.Windows.Xps.Packaging NamespaceOther Resources
Read-Write-Sign an XPS Document SampleCommunity Additions
ADD
Show: