Creating JPEG files From Screen's Aperture?

Dear Denis,

Within the psych toolbox (for Mac), I'm presently using the
screen('CopyWindow'...) command to copy an off-screen window to a small
circular aperture, which is set by the screen(SetDrawingRegion) command.

I'd like to use the IMWRITE command to capture, as a jpeg file, the image
that's being copied from the off-screen window to the circular aperture.

I've been able to use the IMWRITE command to capture the entire on-screen
window, but I've not been able to capture just the aperture image.

Any suggestions on how I might isolate and capture the image shown in the
aperture?

Many thanks!

Nestor


*****************************************************
Nestor Matthews, Ph.D.
Assistant Professor
Department of Psychology
Denison University
100 South Road
Knapp Hall, Room 505A
Granville, OH 43023 USA
Phone: (740) 587-5782
Fax: (740) 587-5675
E-mail: matthewsn@...
http://www.denison.edu/~matthewsn/index.html
*****************************************************
>Dear Denis,
>
>Within the psych toolbox (for Mac), I'm presently using the
>screen('CopyWindow'...) command to copy an off-screen window to a small
>circular aperture, which is set by the screen(SetDrawingRegion) command.
>
>I'd like to use the IMWRITE command to capture, as a jpeg file, the image
>that's being copied from the off-screen window to the circular aperture.
>
>I've been able to use the IMWRITE command to capture the entire on-screen
>window, but I've not been able to capture just the aperture image.
>
>Any suggestions on how I might isolate and capture the image shown in the
>aperture?
>
>Many thanks!
>
>Nestor
>
>
>*****************************************************
>Nestor Matthews, Ph.D.
>Assistant Professor
>Department of Psychology
>Denison University
>100 South Road
>Knapp Hall, Room 505A
>Granville, OH 43023 USA
>Phone: (740) 587-5782
>Fax: (740) 587-5675
>E-mail: matthewsn@...
>http://www.denison.edu/~matthewsn/index.html
>*****************************************************


dear nestor

i'm confused by your message since you claim to use IMWRITE to
capture a window (or offscreen window), yet IMWRITE will only accept
a MATLAB matrix, not a window.

i am quite sure you are in fact using SCREEN GetImage to copy from
your window into a MATLAB matrix, and you're giving that to IMWRITE.
That's the way to do it.

although i implemented the support for SetDrawingRegion, i haven't in
fact used it in my own work. it is possible that you might be able to
somehow clip the SCREEN GetImage. However, it should also be easy to
clip the MATLAB image afterwards.

hope that helps. you seem to already be doing the right things.

best

denis