Condividi tramite


Metodo IXpsOMObjectFactory::CreateGeometryFigure (xpsobjectmodel.h)

Crea un'interfaccia IXpsOMGeometryFigure , che specifica una parte di un oggetto definito da un'interfaccia IXpsOMGeometry .

Sintassi

HRESULT CreateGeometryFigure(
  [in]          const XPS_POINT      *startPoint,
  [out, retval] IXpsOMGeometryFigure **figure
);

Parametri

[in] startPoint

Coordinate del punto iniziale della figura geometry.

[out, retval] figure

Puntatore alla nuova interfaccia IXpsOMGeometryFigure .

Valore restituito

Il metodo restituisce un HRESULT. I valori possibili includono, ma non sono limitati a quelli della tabella che segue. Per informazioni sui valori restituiti dall'API documento XPS non elencati in questa tabella, vedere Errori del documento XPS.

Codice restituito Descrizione
S_OK
Il metodo è riuscito.
E_POINTER
startPoint o figura è NULL.
XPS_E_INVALID_FLOAT
Uno dei campi nella struttura XPS_POINT passato in startPoint contiene un valore non valido.

Commenti

L'esempio di codice seguente illustra come viene usato questo metodo per creare una nuova interfaccia.


IXpsOMGeometryFigure    *newInterface;
// startPoint contains the starting point
// of the geometry figure being created
XPS_POINT                startPoint = {0,0};

// 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))
{
    hr = xpsFactory->CreateGeometryFigure (&startPoint, &newInterface);
    if (SUCCEEDED(hr))
    {
        // use newInterface

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

Requisiti

Requisito Valore
Client minimo supportato Windows 7, Windows Vista con SP2 e Aggiornamento della piattaforma per Windows Vista [app desktop | App UWP]
Server minimo supportato Windows Server 2008 R2, Windows Server 2008 con SP2 e Platform Update per Windows Server 2008 [app desktop | App UWP]
Piattaforma di destinazione Windows
Intestazione xpsobjectmodel.h

Vedi anche

IXpsOMGeometry

IXpsOMGeometryFigure

IXpsOMObjectFactory

XML Paper Specification

Errori del documento XPS

XPS_POINT