InitFromRawSurface method

Initializes a DXSurface object from a client-created object that supports the IDXRawSurface interface.


HRESULT retVal = object.InitFromRawSurface(pRawSurface);


  • pRawSurface [in]
    Type: [IDXRawSurface](aa743626(v=vs.85).md)

    Pointer to an IDXRawSurface interface; if NULL, the surface releases existing surface memory and becomes uninitialized.


The IDXRawSurface interface is used by the DXSurface to obtain a pointers to the surface memory, pitch, pixel format, and color key, and a handle to a device context. Clients that need to perform operations directly on memory buffers or DIB sections can use this mechanism to create DXSurface objects that operate directly on their data.

Raw surface objects are wrappers for application-supplied pixel buffers, such as a Windows Graphics Device Interface (GDI) DIB sections or application-defined memory objects.