The distribution of the magnitude and direction of the uniaxial magnetic anisotropy field over the area of permalloy films obtained by thermal evaporation in vacuum was studied using a scanning ferromagnetic resonance spectrometer. The films were deposited on glass substrates subjected to bending stress in the presence of an in-plane static magnetic field. Depending on the character of the elastic-stress distribution over a local spot of a film, the uniaxial anisotropy induced by a magnetic field is either enhanced or completely compensated, which is accompanied by a significant change in the direction of the easy axis of magnetization. The observed effects are in good agreement with phenomenological calculations.