Displaying a partial image is nearly as simple as displaying a full image. To display a partial image, you must specify an lpSrc rectangle in the ImgDrawImage function call. The source rectangle asks for a rectangular portion of the image, in image coordinates (which are pixels for raster images.) The following code fragment illustrates displaying a 100 x 100 pixel portion (the top left corner) of a previously opened image:
.
.
SetRect(&rSrc, 0, 0, 99, 99);
ImgDrawImage(hImage, hDC, &rDest, &rSrc);
.
.
Note that for this example if the image itself is less than 100 x 100 pixels in size, ImageMan will return an IMG_BAD_SRC error to indicate to your application that the source rectangle is beyond the bounds of the image.
© 1995-2004 Data Techniques, Inc. All rights reserved.