Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATControl::CheckImageSize
CATResult CATControl::CheckImageSize ( CATImage *&  image,
const CATImage baseImage = 0 
) [protected, virtual]

CheckImageSize() performs a sanity check on the image vs. the base image of the control.

Many images in the framework are required to be the same size. For instance, the enabled and disabled images of any control should have the same dimensions - if they don't, then the drawing will be corrupted (or rather, it would, but CheckImageSize() works around that).

By default, image is compared against the class' fImage. If the image sizes do not match, then image is destroyed and recreated in a size that will match - any extra space is filled with red.

If baseImage is provided, then it is used as the point of reference instead of fImage.

Parameters:
image - Image to check size of. If the size is not correct, it will be destroyed and recreated (hence the ref).
baseImage - the image to check against, or null to use fImage of the control.

Definition at line 117 of file CATControl.cpp.

References CAT_ERR_CONTROL_NO_IMAGE, CAT_STAT_CONTROL_IMAGE_SIZE_MISMATCH, CAT_SUCCESS, CATMin(), CATRESULTDESC, CATSUCCEEDED, CATImage::CreateImage(), CATGuiObj::fImage, CATGuiObj::fName, CATImage::Height(), CATImage::ReleaseImage(), and CATImage::Width().

Referenced by CATSwitch::Load(), CATSlider::Load(), CATProgress::Load(), and Load().


Generated on Mon Feb 11 04:10:23 2008 for Game Accessibility Suite by doxygen 1.5.4