Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

XpsImageType Enumeration

Specifies graphical formats for images that can be included in an XpsDocument.

Namespace:  System.Windows.Xps.Packaging
Assembly:  ReachFramework (in ReachFramework.dll)
public enum XpsImageType
<object property="enumerationMemberName" .../>
Member nameDescription
JpegImageTypeJPEG
PngImageTypePNG
TiffImageTypeTIFF
WdpImageTypeWDP

Use this enumeration primarily as a parameter for methods that add images to XML Paper Specification (XPS) documents.

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()

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.