|
|
|
|
MGL_stretchBitmapSection
Stretches a section of a lightweight bitmap to the specified device context.
Declaration
void MGLAPI MGL_stretchBitmapSection(
MGLDC *dc,
int left,
int top,
int right,
int bottom,
int dstLeft,
int dstTop,
int dstRight,
int dstBottom,
const bitmap_t *bitmap,
int op)
Prototype In
mgraph.h
Parameters
dc |
Device context to display bitmap on |
left |
Left coordinate of section to stretch |
top |
Top coordinate of section to stretch |
right |
Right coordinate of section to stretch |
bottom |
Bottom coordinate of section to stretch |
dstLeft |
Left coordinate to stretch bitmap to |
dstTop |
Top coordinate to stretch bitmap to |
dstRight |
Right coordinate to stretch bitmap to |
dstBottom |
Bottom coordinate to stretch bitmap to |
bitmap |
Bitmap to display |
op |
Write mode to use when drawing bitmap |
Description
Stretches a section of a lightweight bitmap to the specified destination rectangle on the device context. The bitmap can be in any color format, and will be translated as necessary to the color format required by the current device context.
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.
Note also that if the source bitmap palette pointer is set to NULL, palette translation is automatically avoided (ie: has the effect of forcing MGL_checkIdentityPalette to false just for that bitmap).
Supported write modes are enumerated in MGL_writeModeType.
See Also
MGL_loadBitmap, MGL_putBitmap, MGL_putBitmapSection, MGL_putBitmapSrcTrans, MGL_putBitmapSrcTransSection, MGL_putBitmapDstTrans, MGL_putBitmapDstTransSection, MGL_putBitmapMask, MGL_putBitmapPatt, MGL_putBitmapPattSection, MGL_putBitmapFx, MGL_putBitmapFxSection, MGL_stretchBitmap, MGL_stretchBitmapSection, MGL_stretchBitmapFx, MGL_stretchBitmapFxSection, MGL_putIcon
Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com