FUNCTION wwgetzoom ;+ ; WWGETZOOM ; ; Get the zoom factor of the current window. ; ; Calling sequence ; ; zoom = wwgetzoom() ; ; Returns the zoom factor in screen pixels per data pixel. If the X and ; Y scales are unequal or the scale factor is not an integer, then 0 ; is returned. ;- datac_0 = convert_coord(0.,0.,/device,/to_data) datac_1 = convert_coord(1.,1.,/device,/to_data) xzoom = abs(1./(datac_1(0) - datac_0(0))) yzoom = abs(1./(datac_1(1) - datac_0(1))) xzoomi=fix(xzoom+0.5) yzoomi=fix(yzoom+0.5) if ((xzoomi ne yzoomi) or abs(xzoomi - xzoom) gt 1e-4) then $ return,0 else return,xzoomi end