PenWidth using FrameRect and DrawLine

Hi all,

I'm trying to draw a rather thick rectangle frame on screen.

I'm having a problem using the parameter "penwidth" in the function 'FrameRect'. It seems that when penwidth is greater than 10, the width ("thickness") ceases to increase, and instead, the edges become longer than they should.

Some more problematic behavior occurred when using the functions 'DrawLines' and 'DrawLine'. Any value greater than 10 is simply treated as 10 (meaning, there's no difference in appearance between width of 10,20 and 72, for example).

On the other hand, 'FrameOval' seems to work fine.

I saw a discussion about some similar problem from around a year ago, but couldn't seem to find any solution/fix/workaround to this, if there is any.

I'm running PTB 3.0.8 on WinXP, with a NVIDIA-GeForce graphics card.

Any help would be greatly appreciated,

Shai.
A quick workaround would be to draw as many nested abutting rectangles as you needed to get the pen width you want. In other words, if you needed a rect with a 20 pixel pen width, draw an inner rect with a 10 pix pen width, and then an outer one 20 pix larger on each dimension, also with a 10 pix pen width.

FrameRect supports list arguments, so you could do this all in one call.

-Lar

On Aug 17, 2010, at 5:23 AM, SG wrote:

> Hi all,
>
> I'm trying to draw a rather thick rectangle frame on screen.
>
> I'm having a problem using the parameter "penwidth" in the function 'FrameRect'. It seems that when penwidth is greater than 10, the width ("thickness") ceases to increase, and instead, the edges become longer than they should.
>
> Some more problematic behavior occurred when using the functions 'DrawLines' and 'DrawLine'. Any value greater than 10 is simply treated as 10 (meaning, there's no difference in appearance between width of 10,20 and 72, for example).
>
> On the other hand, 'FrameOval' seems to work fine.
>
> I saw a discussion about some similar problem from around a year ago, but couldn't seem to find any solution/fix/workaround to this, if there is any.
>
> I'm running PTB 3.0.8 on WinXP, with a NVIDIA-GeForce graphics card.
>
> Any help would be greatly appreciated,
>
> Shai.
>
>
>
>
>
>
>
>
> ------------------------------------
>
> Post your message to: psychtoolbox@yahoogroups.com
> Please indicate OS9, OSX, or WIN version, and include your full name.
> Denis Pelli, David Brainard, and Allen Ingling.
> http://psychtoolbox.org
> Yahoo! Groups Links
>
>
>


------------------------------
Lawrence K. Cormack
Psychology, Neuroscience, and Center for Perceptual Systems
The University of Texas at Austin
--- In psychtoolbox@yahoogroups.com, "SG" <sh_grt@...> wrote:
>
> Hi all,
>
> I'm trying to draw a rather thick rectangle frame on screen.
>
> I'm having a problem using the parameter "penwidth" in the function 'FrameRect'. It seems that when penwidth is greater than 10, the width ("thickness") ceases to increase, and instead, the edges become longer than they should.

Update your Psychtoolbox (UpdatePsychtoolbox), this has been fixed in beta a long time ago.

>
> Some more problematic behavior occurred when using the functions 'DrawLines' and 'DrawLine'. Any value greater than 10 is simply treated as 10 (meaning, there's no difference in appearance between width of 10,20 and 72, for example).
>

For drawing of lines, the limit to a max width of 10 pixels is likely a hardware limitation of NVidia cards. It's present on all NVidia GPU's under OS/X as well. ATI's can go up to 64 pixels.

-mario