ImageGear for C and C++ on Windows v20.3 - Updated
IG_FX_texture
API Reference Guide > Core Component API Reference > Core Component Functions Reference > FX Functions > IG_FX_texture

This function applies a texture to an image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_FX_texture (
        HIGEAR hIGear, 
        const LPAT_RECT lpRect, 
        const HIGEAR hTextureImage 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image to which to apply texture.
lpRect const LPAT_RECT Far pointer to an AT_RECT struct specifying the rectangular portion of the image to be processed. Set = NULL for whole image. Before ImageGear performs this operation, it will check to see if an internal flag has been set to TRUE to make a mask active for this HIGEAR image. If a mask is active, and a valid pointer to a mask can be found, ImageGear will override the settings passed to this structure in favor of the non rectangular ROI defined by the mask.
hTextureImage const HIGEAR HIGEAR handle of the 8 bit image to be applied to image hIGear to produce textured effect.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Sample:

FlashPix

Example:

 
Copy Code
HIGEAR hIGear;    /* Handle of image to be textured */
HIGEAR hTextureImage; /* Handle of 8 x 8 pixel 8-bit gray level texturing image */
/* Apply texture to the whole image: */
IG_FX_texture ( hIGear, NULL, hTextureImage );

Remarks:

The texturing image is a small 8-bit grayscale image that is treated as a sign centered image. Pixels in the texture image that are 127 have no effect on the original image, and the farther a texture image pixel is from 127, the greater its effect. The texture image is tiled over the entire original image starting in the top left corner. Any left over is clipped.

Sign centered images can be created using the emboss function.

This function, like other ImageGear Image Processing and Clipboard API calls, takes an AT_RECT structure as an argument, so that you can process a rectangular sub-region of an image. However, before ImageGear performs the operation specified by this function, it will check to see if an internal flag has been set to TRUE, indicating that a mask HIGEAR should be used with the image. If the flag is set to TRUE, and a valid pointer to a mask image has been assigned, ImageGear will override the settings passed to the AT_RECT structure and use the non-rectangular ROI defined by the mask HIGEAR. To create a non-rectangular region of interest, call IG_IP_NR_ROI_to_HIGEAR_mask().

See the descriptions of IG_IP_NR_ROI_mask_associate and IG_IP_NR_ROI_to_HIGEAR_mask for more details.
Is this page helpful?
Yes No
Thanks for your feedback.