The aim of the present invention is to provide a projector device and a medical device with said projector device, said projector device facilitating an improved measurement of the local refractive power of an optical body, in particular an eye.For this purpose, the invention proposes a projector device for projecting a two-dimensional pattern on a plane, in particular in a human eye, with at least one light source (LS1, LS2) which generates a light beam, with a deflecting device (MSS) which facilitates a deflection of the light beam at a deflection angle in order to generate the two-dimensional pattern on the plane, with a beam path which extends at least from the light source (LS1, LS2) to the plane, with at least one sensor device (L1, D1, W2, D2) which is designed to determine the actual state of a wavefront of the light beam at any position of the beam path, and with at least one correcting device (EL O2, O3) which is arranged in the beam path and which facilitates an alteration of the wavefront of the light beam. In accordance with the invention, a position-resolved alteration of the wavefront is carried out by an optical control element with a variable focal length.