Microsoft DirectX 8.1 (C++)

CImageAllocator::CImageAllocator

Constructor method.

Syntax

CImageAllocator(
  CBaseFilter *pFilter,
  TCHAR *pName,
  HRESULT *phr
);

Parameters

pFilter

Pointer to the owning filter object.

pName

Pointer to a debug-only string description.

phr

Pointer to a COM return code.

Return Value

No return value.

Remarks

The CImageAllocator, CImageSample, and CDrawImage classes are all tightly associated. The buffers that the image allocator creates are made using the Microsoft Win32 CreateDIBSection function. The allocator then creates its own samples (based on the CImageSample class). The image samples are initialized with the buffer pointer and its length. The sample is also passed in a structure (a DIBDATA structure) that holds a number of pieces of information obtained from the CreateDIBSection call.

These samples can then be passed to the draw object. The draw object knows the private format of the samples and how to get back the DIBDATA structure from them. Once it has obtained that information, it can pass a bitmap handle that is stored in the DIBDATA structure down into GDI when it draws the image that the sample contains. By using the bitmap handle from the sample in the drawing, rather than just the buffer pointer (which is the alternative if the sample is not a CImageSample), it gets a modest performance improvement.

This is a protected member function.

See Also