Glossary Item Box
This function forces all or part of a given image to be "loaded", i.e., read in from disk into a DIB or Metafile.
|
Parameter |
Type |
Description |
|
hImage |
HANDLE |
hImage Identifies the image to load. |
|
lpRect |
LPRECT |
Specifies the portion of the image to load, in image coordinates. |
Return Value
Returns IMG_OK on success, an error value otherwise.
Comments
An image is not loaded when ImgOpen is called; instead, ImageMan gives each application explicit control over when or if the image is loaded. While this function loads the image explicitly, there are several which will, if called when the image is not loaded, implicitly load the entire image. These are as follows:
If ImgLoad is used to load a portion of an image, subsequent calls to ImgGetInfo will reflect the image's loaded dimensions, not it's original size. To restore the image at it's original dimensions, use the ImgUnload function.
Note
The ImgCopy function operates as a special case in order to allow an application to reduce a large image to a smaller one without having to have the large image entirely in memory. If the image to copy isn't loaded at the time of the ImgCopy call, it will be loaded in small bands and copied piecemeal to the destination image when the ImgCopy function is completed, the source image will not have a loaded image to draw from. Of course, if the source image is already loaded, ImgCopy will simply copy it to the destination and the original image will remain loaded and intact.
Copyright 2008 Data Techniques, Inc. All Rights Reserved