Navigation:  ThinBASIC Modules > UI (User Interface) > Additional Controls and Functions > Canvas Control >

Canvas_Stretch2

Previous pageReturn to chapter overviewNext page

 

Description

 

Copy and resize a bitmap to the selected canvas target.

Copy a complete bitmap, or a portion of it, to the selected canvas target, while resizing it to a larger or smaller size

 

Syntax

 

n = Canvas_Stretch1(hBmp, ID, SX1, SY1, SX2, SY2, DX1, DY1, DX2, DY2 [, Mix, Stretch])

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning

hBmp

Number

No

specifies the handle of the source bitmap, control, or window

ID

Number

No

identifier assigned with the CONTROL ADD CANVAS.
ID must be zero (0) for a Canvas Window or a Bitmap.

SX1

Number

No

Source X1

SY1

Number

No

Source Y1

SX2

Number

No

Source X2

SY2

Number

No

Source Y2

DX1

Number

No

Destination X1

DY1

Number

No

Destination Y1

DX2

Number

No

Destination X2

DY2

Number

No

Destination Y2

Mix

Number

Yes

One of the following equates:

%Canvas_mix_BlacknessPixel is always 0 (black).
%Canvas_mix_NotMergeSrcPixel is the inverse of the MergeSrc color.
%Canvas_mix_MaskNotSrcPixel is a combination of the colors common to both the pixel and the inverse of the source.
%Canvas_mix_NotCopySrcPixel is the inverse of the pen color.
%Canvas_mix_MaskSrcNotPixel is a combination of the colors common to both the source and the inverse of the pixel.
%Canvas_mix_NotPixel is the inverse of the pixel color.
%Canvas_mix_XorSrcPixel is a combination of the colors in the source and in the pixel, but not in both.
%Canvas_mix_NotMaskSrcPixel is the inverse of the MaskSrc color.
%Canvas_mix_MaskSrcPixel is a combination of the colors common to both the source and the pixel.
%Canvas_mix_NotXorSrcPixel is the inverse of the XorSrc color.
%Canvas_mix_NopPixel remains unchanged.
%Canvas_mix_MergeNotSrcPixel is a combination of the source color and the inverse of the pixel color.
%Canvas_mix_CopySrcPixel is the source color (default).
%Canvas_mix_MergeSrcNotPixel is a combination of the source color and the inverse of the pixel color.
%Canvas_mix_MergeSrcPixel is a combination of the source color and the pixel color.
%Canvas_mix_WhitenessPixel is always 1 (white)

Stretch

Number

Yes

If present, one of the following equates:

 

%Canvas_BLACKONWHITEThis 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.
%Canvas_WHITEONBLACKPerforms a boolean OR of eliminated and existing pixels.  It preserves white pixels at the expense of black pixels.
%Canvas_COLORONCOLORDeletes eliminated lines of pixels without trying to preserve their information.
%Canvas_HALFTONEThis 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.

 

Remarks

 

The destination of the stretch operation is always the attached graphic target

 

Restrictions

 

See also

 

Examples