drawing an image on the center of the screen (ptb 3, osx)

Hello All,

What is the standard / most straightforward way of drawing an image
(e.g., a jpg) on the center of the screen in PTB 3 on OSX? I see that
there is a function that does this for text (DrawFormattedText).
However, it looks like you have to manually specify screen
coordinates by passing the "rect" argument to Screen DrawTexture in
order to center an image.

It's easy enough to manually determine those coordinates by trial-and-
error. I take it, though, that there is a way to 1.) calculate how
big the rect needs to be based on the size of your image file and 2.)
figure out where to place the rect in order to center it on the basis
of the parameters of your particular screen and the size of the rect.
But I'm completely flummoxed when it comes to actually doing these
two things.

General guidelines would be very much appreciated. Sample code would
be wonderful.

Thanks!
Joe Paxton

--
Joseph M. Paxton
Research Assistant
Department of Psychology
William James 1482
33 Kirkland Street
Harvard University
Cambridge, MA 02138
Phone: 617-495-3878