views:

38

answers:

0

EncodedImage.scaleImage32 is throwing error out of memory when crossing bounds to 1800,1800. Is there any work around for the same.

public EncodedImage sizeImage(EncodedImage image, int width, int height) {
    EncodedImage result = null;

    int currentWidthFixed32 = Fixed32.toFP(image.getWidth());
    int currentHeightFixed32 = Fixed32.toFP(image.getHeight());

    int requiredWidthFixed32 = Fixed32.toFP(width);
    int requiredHeightFixed32 = Fixed32.toFP(height);

    int scaleXFixed32 = Fixed32.div(currentWidthFixed32,
    requiredWidthFixed32);
    int scaleYFixed32 = Fixed32.div(currentHeightFixed32,
    requiredHeightFixed32);

    result = image.scaleImage32(scaleXFixed32, scaleYFixed32);

    return result;
}