Game Accessibility Library logo SourceForge.net Logo
Game Accessibility Suite: CATImage::CreateSub
CATResult CATImage::CreateSub ( const CATImage orgImg,
CATImage *&  dstImg,
CATInt32  xOffset,
CATInt32  yOffset,
CATInt32  width,
CATInt32  height 
) [static]

CreateSub creates a sub-image of the specified parent.

dstImage should not be instantiated prior to calling CreateSub. Sub image is returned in dstImage.

The sub image references the parent's fData member, and the parent image must not be deleted before you are done using the sub image.

You may create a sub image of a sub image, ad infinum. It'll handle the offsets. Call CATImage::ReleaseImage() when done.

Parameters:
orgImg - parent image to derive subimage from.
dstImg - uninitialized image ptr. Set on return.
xOffset - relative x offset for top-left of sub image.
yOffset - relative y offset for top-left of sub image.
width - width of sub image.
height - height of sub image.
Returns:
CATResult result code
See also:
CATImage::ReleaseImage()

CATImage::SetSubPosition()

Definition at line 127 of file CATImage.cpp.

References AddRef(), CAT_ERR_IMAGE_INVALID_SUB_POSITION, CAT_SUCCESS, CATASSERT, CATFAILED, CATRESULT, CreateImage(), fData, fHeight, fOwnData, fParentImage, fWidth, fXOffset, and fYOffset.

Referenced by CATTab::Draw(), and CATLayer::Draw().


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