### Image Sampling

Image sampling is the process of investigating the status of an image prior to drawing it when the image is either:

- Interpolated (enlarged), increasing the number of pixels during fractional translates and scales that result in stretching
- Decimated (shrunk), reducing the number of pixels during scale operations that result in shrinking

The image sampling control applies for the geometry of IGImage only. When a rendered image undergoes a transformation composed of something other than an integral translation, it is necessary to resample the image. When an image is drawn on one device and then drawn on another device of a different resolution, it is interpolated or decimated as appropriate to maintain the same size on both devices. Interpolation and decimation also occur during rotate, scale, perspective, and translate operations on the image graphic. Both interpolation and decimation can be used during a perspective transformation.

The IImageSamplingControl attribute allows you to control the filtering method employed during interpolation and decimation.

The enumerated type ESampleMode provides several stock filtering methods:

- kBlackOnWhite
- kWhiteOnBlack
- kColorOnColor
- kHalfTone

These modes map directly into corresponding StretchBltMode for the GDI StretchBlt function.