GRAPHIC GET STRETCHMODE statement  

Purpose

Retrieves the default bitmap stretching mode for the attached DC.

Syntax

GRAPHIC GET STRETCHMODE TO ModeVar&

Function Form:

ModeVar& = GRAPHIC(STRETCHMODE)

Remarks

There are several operations in PowerBASIC which involve stretching or condensing images on bitmaps, most notably GRAPHIC STRETCH.  As individual pixels must be added or removed, there is a good chance that the quality of the image will be degraded.  However, if you describe the nature of the image by defining a StretchMode, you can substantially enhance the appearance.

The default StretchMode is maintained individually for each DC.  You can retrieve the default mode with this statement, or set it with GRAPHIC GET STRETCHMODE.  Of course, you can also override the default StretchMode when you execute one of the affected statements.

The 4 stretch mode equates are predefined in PowerBASIC.

Equate

Value

Description

%BLACKONWHITE

1

This is the default Windows stretch mode, and is most appropriate for monochrome bitmaps, or those with blocks of color. Performs a boolean OR of eliminated and existing pixels. It preserves black pixels at the expense of white pixels.

%WHITEONBLACK

2

Performs a boolean OR of eliminated and existing pixels.  It preserves white pixels at the expense of black pixels.

%COLORONCOLOR

3

Deletes eliminated lines of pixels without trying to preserve their information.

%HALFTONE

4

This provides the highest quality for complex color bitmaps.  The average color of the destination pixel block is kept approximately the same as the source pixel block.

See also

GRAPHIC BITMAP LOAD, GRAPHIC COPY, GRAPHIC RENDER, GRAPHIC SET STRETCHMODE, GRAPHIC STRETCH