I’m trying to get the size of the image displayed by the image view. Not the actual size of the file but the size as it is being displayed in my app. I’m need to find the top left corner of the image being displayed. I have the image view set to display proportional but sometimes the image is smaller than the image view size. Sometimes the height is fits but the width is smaller, other times vice versa.
I tried this:
set imgSize to size of image of image view “img1” of window “mainWin”
Try the handler below after loading your image file (here indicated as “theFile”):
on get_imageDimension(theFile)
try
tell application "Image Events"
launch
set tmpImage to open theFile
set {tmpImageX, tmpImageY} to dimensions of tmpImage
close tmpImage
end tell
return {tmpImageX, tmpImageY}
on error error_message
display dialog error_message
end try
end get_imageDimension