This property sets the mode used to expand or contract the bitmap.

[C++Builder]   imagekitcontrolname->StretchMode[= short ]
[Delphi]   imagekitcontrolname.StretchMode[= Smallint ]

Property Value

Value Explanation
0 ImageKit high quality display function for expanding and contracting bitmaps. (Using this setting is the same as setting the Refine1BitImage and RefineColorImage properties to True)
1 Performs a Boolean AND operation using the color values for the eliminated and existing pixels. If the bitmap is a monochrome bitmap, this mode preserves black pixels at the expense of white pixels.
(BLACKONWHITE)
2 Performs a Boolean OR operation using the color values for the eliminated and existing pixels. If the bitmap is a monochrome bitmap, this mode preserves white pixels at the expense of black pixels.
(WHITEONBLACK)
3 (Default value) Deletes the pixels. This mode deletes all eliminated lines of pixels without trying to preserve their information.
(COLORONCOLOR)
4 Maps pixels from the source rectangle into blocks of pixels in the destination rectangle. The average color over the destination block of pixels approximates the color of the source pixels.
(HALFTONE)

The value in the parentheses () are the same constants used by Windows API

Explanation

The StretchMode property sets the mode used to expand or contract the bitmap. The default value is 3 (COLORONCOLOR). When this property is set to values ranging from 1 to 4, images are processed in the same way as the Windows API SetStretchBitMode function.

Values 1 (BLACKONWHITE) and 2 (WHITEONBLACK) are low quality but faster than the high quality value 3 (COLORONCOLOR). Value 4 (HALFTONE) is high quality as well but also slower than values 1 or 2. We recommend that you use value 3 (COLORONCOLOR) for most images and when contracting bitmaps, use 4 (HALFTONE).

Even when using 0(vikRefineImage), if the Edit.EditEnable property is true, the image will be displayed without high quality display (i.e. it will be displayed as is).

Setting this value

This value can be set at run-time.

Retrieving this value

This value can be retrieved at run-time.

[Differences from the ImageKit7 ActiveX/VCL]
Setting the StretchMode property to 0 (vikRefineImage) is the same as using the IK7 Refine1BitImage and RefineColorImage properties.

[Differences from the ImageKit8/9/10 ActiveX]
The ActiveX constant, ikRefineImage is changed to vikRefineImage. Aside from that constant, other constants from Windows Unit may be used.
(In ActiveX the constants are ikRefineImage, ikBlackOnWhite, ikWhiteOnBlack, ikColorOnColor, and ikHaltone.)

 

The ImageKit10 VCL is a product created by Newtone Corporation