Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Due to various hardware limitations, some device drivers impose restrictions on the position and size of the source and destination rectangles used to display overlay surfaces. To find out which restrictions apply for a device, call the IDirectDraw::GetCapsmethod and then examine the overlay-related flags in the dwCapsmember of the DDCAPSstructure. The following table shows the members and flags specific to boundary and size alignment restrictions.

Category Flag Member

Boundary (position) restrictions

DDCAPS_ALIGNBOUNDARYSRC

dwAlignBoundarySrc

 

DDCAPS_ALIGNBOUNDARYDEST

dwAlignBoundaryDest

Size restrictions

DDCAPS_ALIGNSIZESRC

dwAlignSizeSrc

 

DDCAPS_ALIGNSIZEDEST

dwAlignSizeDest

There are two types of restrictions, boundary restrictions and size restrictions. Both types of restrictions are expressed in terms of pixels (not bytes) and can apply to the source and destination rectangles. Also, these restrictions can vary depending on the pixel formats of the overlay and primary surface.

Boundary restrictions affect where you can position a source or destination rectangle. The values in the dwAlignBoundarySrcand dwAlignBoundaryDestmembers tell you how to align the top left corner of the corresponding rectangle. The x-coordinate of the top left corner of the rectangle (the leftmember of the RECTstructure), must be a multiple of the reported value.

Size restrictions affect the valid widths for source and destination rectangles. The values in the dwAlignSizeSrcand dwAlignSizeDestmembers tell you how to align the width, in pixels, of the corresponding rectangle.

Your rectangles must have a pixel width that is a multiple of the reported value. If you stretch the rectangle to comply with a minimum required stretch factor, be sure that the stretched rectangle is still size aligned.

After stretching the rectangle, align its width by rounding up, not down, so you preserve the minimum stretch factor.

For more information, see Minimum and Maximum Stretch Factors.