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. |
The IDirectDrawSurface5::AlphaBltmethod blits a rectangular source image to a destination rectangle.
HRESULT AlphaBlt( LPRECT lpDestRect , LPDIRECTDRAWSURFACE4 lpDDSrcSurface , LPRECT lpSrcRect , DWORD dwFlags , LPDDALPHABLTFX lpDDAlphaBltFX );
Parameters
|
Uses the color key associated with the source surface. Source pixels matching the color key are transparent when blitted to the destination. The source color-key value was specified in an earlier call to IDirectDrawSurface5::SetColorKey. The DDABLT_KEYSRCflag cannot be set if the source surface contains an alpha channel. |
|
Writes the source pixel values to the destination surface without blending. The pixels are converted from the source pixel format to the destination format, but no color keying, alpha blending, or RGBA scaling is performed. In the case of a fill operation ( lpDDSrcSurface=NULL), lpDDAlphaBltFX->dwFillValuecontains the source alpha and color components that are to be converted to the destination pixel format and used to fill the destination. This flag cannot be used with the DDABLT_KEYSRCand DDABLT_KEYDESTflags. |
|
Mirrors the source image left-to-right in the destination rectangle. |
|
Mirrors the source image vertically in the destination rectangle. |
|
Causes the runtime to allow the set of RGBA-scaling factors passed by the application to be degraded from distinct values into one or two values, based on the capabilities of the driver. The default behavior is to honor the contents of the RGBA-scaling factors and only call a driver that can perform the RGBA-scaling operation as specified. |
|
Mandates hardware acceleration to perform the blit. If the display hardware is unable to perform the blit, the call fails. This flag overrides DirectDraw's default behavior, which is to attempt to perform the blit with software emulation in the event that the display hardware cannot handle it. |
|
Waits for a previously initiated drawing operation to complete instead of returning immediately with the DDERR_WASSTILLDRAWINGreturn value. In the event that a previous drawing operation is still in progress at the time of the call, this flag defers returning from the call until either the new blit operation begins or an error occurs. |
|
Utilize filtering to enhance the image quality of stretch operations. |
|
Utilize nearest-neighbor source pixels in stretch operations. This is the default. |
|
If a previous drawing operation is still pending, return DDERR_WASSTILLDRAWINGinstead of waiting for it to finish. This is the default. |
|
Fill the destination surface with the pixel value contained in lpDDAlphaBltFx->dwFillValue. |
|
Mandates that the blit be performed by the hardware emulation layer. If the HEL is not present, the blit returns DDERR_UNSUPPORTED. |
|
When filtering, pixels located on the border of the source rectangle are treated as transparent in order to have a smooth blend from the destination to the source pixels. |
Return Values
DDERR_GENERIC | DDERR_NOPALETTEATTACHED |
DDERR_INVALIDOBJECT | DDERR_NOSTRETCHHW |
DDERR_INVALIDPARAMS | DDERR_OVERLAPPINGRECTS |
DDERR_INVALIDRECT | DDERR_SURFACEBUSY |
DDERR_NOALPHAHW | DDERR_SURFACELOST |
DDERR_NOBLTHW | DDERR_UNSUPPORTED |
DDERR_NOMIRRORHW |
Remarks
When lpDDSrcSurface= NULL, the lpSrcRectargument must also equal NULL.. In addition, the following flags must not be set: DDABLT_KEYSRC, DDABLT_MIRRORLEFTRIGHT, and DDABLT_MIRRORUPDOWN. Otherwise, the call will fail.
If a FOURCC surface contains an alpha channel, that channel is automatically enabled unless the DDABLT_NOBLENDflag is set.
Overlapping rectangles are not supported. The call fails if the source and destination rectangles lie on the same surface and overlap each other. Applications should use the IDirectDrawSurface5::Bltcall to perform scrolling and other blit operations that involve overlapping rectangles.
Requirements
Runs on | Versions | Declared in | Link to |
---|---|---|---|
Windows CE OS | 2.12 or later. Version 2.12 requires DXPAK 1.0 or later. | ddraw.h | ddraw.lib |