ScaleFitToSize method

Sets the scale factors used to fit a portion of the input to match a specified size.

Syntax

HRESULT retVal = object.ScaleFitToSize(pClipBounds, FitToSize, bMaintainAspect);

Parameters

  • pClipBounds [in, out]
    Type: DXBNDS

    Pointer to the portion of the input to map. NULL indicates that the entire input is to be used.

  • FitToSize [in]
    Type: SIZE

    Size of the desired result.

  • bMaintainAspect [in]
    Type: BOOL

    BOOL that indicates how scale factors are used. If TRUE, this method sets the scale factors to fit the result within the window, maintaining the aspect ratio of the region specified by pClipBounds. If FALSE, the scale factors are set to create a result that equals the FitToSize parameter value.

Remarks

This method automatically calculates the scale factors needed to scale a clipped input image to a known size. The scale factors are a simple ratio of the input size and boundary lengths along each dimension.

The values passed to pClipBounds in this method should be the same as those passed to the IDXTransform::Execute method.

See also

DXBNDS