|
|
|
|
MGL_stretchBltFxCoord
Stretches a block of image data from one device context to another, while applying different effects in the process.
Declaration
void MGLAPI MGL_stretchBltFxCoord(
MGLDC *dst,
MGLDC *src,
int left,
int top,
int right,
int bottom,
int dstLeft,
int dstTop,
int dstRight,
int dstBottom,
bltfx_t *fx)
Prototype In
mgraph.h
Parameters
dst |
Destination device context |
src |
Source device context |
left |
Left coordinate of source image |
top |
Top coordinate of source image |
right |
Right coordinate of source image |
bottom |
Bottom coordinate of source image |
dstLeft |
Left coordinate of destination image |
dstTop |
Top coordinate of destination image |
dstRight |
Right coordinate of destination image |
dstBottom |
Bottom coordinate of destination image |
fx |
Information describing the effects to apply to the blit (bltfx_t) |
Description
Copies a block of bitmap data form one device context to another, stretching or shrinking the image as necessary to fit the destination rectangle for the destination device context, while applying optional effects. This function behaves identically to the MGL_bitBltFxCoord function, except it includes the ability to stretch the bitmap at the same time. You can use the flags member of the bltfx_t structure to define whether stretching is done using nearest color stretching or if pixel interpolation will be used. If you don't specify any flags, nearest color stretching will be used.
This function will correctly handle effects Blt's across device contexts with differing pixel depths, and will perform the necessary pixel format translation to convert from the source device to the destination device. Note that although the code to implement this is highly optimized, this can be a time consuming operation so you should attempt to pre-convert all bitmaps to the current display device pixel format for maximum performance if using this routine for sprite animation.
When this function is called for 4 and 8 bit source bitmaps being copied to either 4 or 8bpp destination device contexts, MGL first checks if the color palettes for the source and destination bitmaps are the same. If they are not, MGL translates the pixel values from the source bitmap to the destination color palette, looking for the closest match color if an exact match is not found. In order to obtain maximum performance for blt’ing bitmaps in color index modes, you should ensure that the color palette in the source device matches the color palette in the destination device to avoid on the fly palette translation. If you know in advance that the palette is identical for a series of blit operations, you can turn off all identity palette checking in MGL with the MGL_checkIdentityPalette function.
When this function is called for 4 and 8 bit source bitmaps being copied to RGB destination device contexts, MGL will convert the pixels in the source bitmap using the source bitmap palette to map them to the destination pixel format. If however you know in advance that the palette for all source bitmaps is identical for a series of blit operations, you can use the MGL_checkIdentityPalette function to disable source palette translation. In this case the MGL will translate all color index bitmaps using the pre-defined color translation palette stored in the destination device context. You would then set the destination device context palette to the common palette for all blit operations using MGL_setPalette. If you are translating a lot of color index bitmaps, this will increase performance by avoiding the need to convert the palette entries to the destination pixel format for every blit operation.
The source and destination rectangles are clipped according to the current clipping rectangles for the source and destination device contexts respectively.
Note: This function is not designed to support overlapping source and destination rectangles on the same device context so if the source and destination rectangles overlap on the same device context, the results are undefined.
See Also
MGL_bitBlt, MGL_bitBltCoord, MGL_srcTransBlt, MGL_srcTransBltCoord, MGL_dstTransBlt, MGL_dstTransBltCoord, MGL_bitBltPatt, MGL_bitBltPattCoord, MGL_bitBltFx, MGL_bitBltFxCoord, MGL_stretchBlt, MGL_stretchBltCoord, MGL_stretchBltFx, MGL_stretchBltFxCoord, MGL_copyPage, MGL_copyPageCoord
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com