XpsImageType 열거형

정의

XpsDocument에 포함할 수 있는 이미지의 그래픽 형식을 지정합니다.

public enum class XpsImageType
public enum XpsImageType
type XpsImageType = 
Public Enum XpsImageType
상속
XpsImageType

필드

JpegImageType 1

Jpeg.

PngImageType 0

Png.

TiffImageType 2

TIFF

WdpImageType 3

WDP.

예제

다음 예제에서는 XPS(XML Paper Specification) 문서에 이미지를 추가할 때 이 열거형을 사용하는 방법을 보여 줍니다.

// ---------------------------- 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()
' ---------------------------- 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 Sub Create(xpsDocument As XpsDocument)
    ' Create the document sequence
    Dim docSeqWriter As IXpsFixedDocumentSequenceWriter = xpsDocument.AddFixedDocumentSequence()

    ' Create the document
    Dim docWriter As IXpsFixedDocumentWriter = docSeqWriter.AddFixedDocument()

    ' Create the Page
    Dim pageWriter As IXpsFixedPageWriter = docWriter.AddFixedPage()

    ' Get the XmlWriter
    Dim xmlWriter As 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 Sub

설명

이 열거형은 주로 XPS(XML Paper Specification) 문서에 이미지를 추가하는 메서드에 대한 매개 변수로 사용합니다.

적용 대상