Use the sample allocation helper functions for allocating arrays of samples that can be copied to DXSurfaces. In common usage, you would allocate an array of samples as a buffer and call the IDXARGBReadPtr::Unpack, IDXARGBReadPtr::UnpackPremult, or IDXARGBReadPtr::UnpackRect methods to store the samples of a DXSurface into the buffer. The buffer contents can be written back to a DXSurface with the IDXARGBReadWritePtr::PackAndMove or IDXARGBReadWritePtr::PackPremultAndMove methods.
To use these functions, you must include the file Dxhelper.h from the DXMedia\Include directory in your program.
Sample Allocation Functions
DXBASESAMPLE_Alloca Allocates an array of DXBASESAMPLE structures. DXPMSAMPLE_Alloca Allocates an array of DXPMSAMPLE structures. DXSAMPLE_Alloca Allocates an array of DXSAMPLE structures.
Allocates an array of DXBASESAMPLE structures.
Syntax
DXBASESAMPLE_Alloca( ulNumSamples );
Parameters
- ulNumSamples
- [in] Number of samples to allocate.
Return Value
Returns a pointer to the array of samples, or NULL if the allocation fails.
Allocates an array of DXPMSAMPLE structures.
Syntax
DXPMSAMPLE_Alloca( ulNumSamples );
Parameters
- ulNumSamples
- [in] Number of samples to allocate.
Return Value
Returns a pointer to the array of samples, or NULL if the allocation fails.
Allocates an array of DXSAMPLE structures.
Syntax
DXSAMPLE_Alloca( ulNumSamples );
Parameters
- ulNumSamples
- [in] Number of samples to allocate.
Return Value
Returns a pointer to the array of samples, or NULL if the allocation fails.
Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.