I am using below code to resize image in blackberry but it resulting into poor quality of image. Please advise on the same.
{
JPEGEncodedImage encoder = null;
encode_image = sizeImage(encode_image, (int)newWidth,(int)newHeight);
encoder=JPEGEncodedImage.encode(encode_image.getBitmap(),100);
}
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;
}