I'm trying to modify a script that sets the scales an image to the maximum width/height based on the widthset/heightset variables. I'd like to be able to scale the image to a minimum width/height but I can't wrap my head around the maths.
[CODE]'get aspect ratio
picMat.GetDimensions(imageWidth, imageHeight)
aspect = imageWidth / imageHeight
'This the code I'd like to edit so that if minmax="MIN" it will scale an image to a minimum width or height
if ucase(minmax)="MAX" then
if imageHeight > imageWidth then
scaleY = heightset / currHeight
scaleX = (heightset * aspect) / currWidth
else
scaleX = widthset / currWidth
scaleY = (widthset / aspect) / currHeight
end if
end if