The StretchImage method also draws one bitmap on top of another, but instead of allowing a rectangle of the source bitmap to be selected for the draw operation, the entire source rectangle is stretched or shrunk to fit a destination rectangle.
Bitmap snowflake = Resources.GetBitmap(Resources.BitmapResources.MFsnowflake); myBitmap.StretchImage( 10, 10, // destination x, y snowflake, // source bitmap 200, 100, // width and height of destination 0xff); // opacity myBitmap.Flush();
Irrespective of the size of the original, the snowflake will be drawn in a rectangle 200 pixels wide and 100 pixels high (Figure 7-9). The snowflake image doubled in width during the draw process.
Figure 7-9: The snowflake image stretched into a 200-pixel by 100-pixel destination region.