ImageMan DLL Suite Version 8Submit feedback on this topic   

ImgCopy

HANDLE IMAPI ImgCopy (hImage, nWid, nHi, lpSrc, lFlags)

This function copies all or part of the given image into another image, size nWid x nHi, returning an ImageMan handle which represents the new image.

 

Parameter

Type

Description

hImage

HANDLE

Identifies the image to copy from.

nWid

int

Specify the width of the resulting image.

nHi

int

Specify the height of the resulting image.

lpSrc

LPRECT

Specifies the portion of the source image to copy into the new image. If NULL, the entire image is copied.

lFlags

LONG

Specifies scaling method to use when scaling images.

 

 

  Valid values for the lFlags parameter are:

 

Value

Description

COPY_DEL

delete pixels w/out regard to color fastest

COPY_AND

preserve black pixels

COPY_OR

preserve white pixels

COPY_ANTIALIAS

produces a 16-color grayscale image

COPY_ANTIALIAS256

produces a 256-color grayscale image

COPY_INTERPOLATE

interpolates pixel values when scaling - this produces a much higher quality image but is slower -24 Bit Images Only

 

 

Return Value

Return value is a valid ImageMan image handle on success, 0 on failure. In the event of an error, the ImgGetStatus function will return the applicable error code.

 

Comments

ImgCopy is one of the most important functions available in ImageMan. With it you can scale an existing image, or portion thereof, up or down however you like.

 

If the source image is not currently loaded, ImgCopy will perform the image copy in bands, allowing an application to create a low-resolution copy of a much larger image without having the larger image entirely in memory at any point.

 

When scaling monochrome images, the lFlags parameter allows you to determine how the scaling will be carried out. By using the COPY_AND or COPY_OR flags, you can preserve black or white pixels, respectively, in the reduced image. In addition, the COPY_ANTIALIAS flag creates a grayscale image which is a much better approximation of the actual source image, especially at small sizes.

 

When scaling 24 bit color images the COPY_INTERPOLATE flag may be used to specify that interpolation be used resulting in enhanced image quality.

 

It should be noted that the COPY_DEL will produce results more quickly than the other options; if your application doesn't need to preserve black or white pixels, use the COPY_DEL flag if possible.

 

 


© 1995-2004 Data Techniques, Inc. All rights reserved.