Interface IXpsOMImageResource (xpsobjectmodel.h)

Fournit une interface IStream à une ressource d’image.

Héritage

L’interface IXpsOMImageResource hérite d’IXpsOMResource. IXpsOMImageResource a également les types de membres suivants :

Méthodes

L’interface IXpsOMImageResource possède ces méthodes.

 
IXpsOMImageResource ::GetImageType

Obtient le type de ressource d’image.
IXpsOMImageResource ::GetStream

Obtient une nouvelle copie en lecture seule du flux associé à cette ressource. (IXpsOMImageResource.GetStream)
IXpsOMImageResource ::SetContent

Définit le flux en lecture seule à associer à cette ressource. (IXpsOMImageResource.SetContent)

Remarques

L’exemple de code qui suit montre comment créer un instance de cette interface.


IXpsOMImageResource    *newInterface;
// The following values are defined outside of 
// this example.
//  IStream            *acquiredStream;
//  XPS_IMAGE_TYPE     contentType;
//  IOpcPartUri        *partUri;
    
// Note the implicit requirement that CoInitializeEx 
//  has previously been called from this thread.

hr = CoCreateInstance(
    __uuidof(XpsOMObjectFactory),
    NULL,
    CLSCTX_INPROC_SERVER,
    _uuidof(IXpsOMObjectFactory),
    reinterpret_cast<LPVOID*>(&xpsFactory)
    );

if (SUCCEEDED(hr))
{
    // The partUriString and acquiredStream variables 
    //   are defined outside of this example.
    hr = xpsFactory->CreatePartUri(partUriString, &partUri);
    if (SUCCEEDED(hr))
    {
        hr = xpsFactory->CreateImageResource (
            acquiredStream,
            contentType,
            partUri,
            &newInterface);
        if (SUCCEEDED(hr))
        {
            // use newInterface

            newInterface->Release();
        }
        partUri->Release();
    }
    xpsFactory->Release();
}
else
{
    // evaluate HRESULT error returned in hr
}

Configuration requise

   
Client minimal pris en charge Windows 7, Windows Vista avec SP2 et Mise à jour de plateforme pour Windows Vista [applications de bureau | Applications UWP]
Serveur minimal pris en charge Windows Server 2008 R2, Windows Server 2008 avec SP2 et Mise à jour de plateforme pour Windows Server 2008 [applications de bureau | Applications UWP]
Plateforme cible Windows
En-tête xpsobjectmodel.h

Voir aussi

IXpsOMObjectFactory ::CreateImageResource

IXpsOMResource

Interfaces

XML Paper Specification