Hi,
I am having a Image of size width=700 and height=500, I want to reduce the image and display it within the allocated space of width=400 and height=300.
I am using the following javascript code to reduce the image in proponate ratio.
if(iImageWidth > 400 || iImageHeight > 300){
while(!(iImageWidth <= 400 && iImageHeight <= 300)){
iImageWidth = iImageWidth * 0.99;
iImageHeight = iImageHeight * 0.99;
}
}
x.width = iImageWidth;
x.height = iImageHeight;
Everything is working fine and i am getting the reduced image. But my problem is the result image get distorted (Its not clear as the original image). When we zoom in a image its clear but when we reduced the width and height its not clear as zoom in image.
Please help to resolve this issue.
Thanks in advance.