# Presto rectangle with curved corners

**URL:** <https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052>\
**Category:** Support\
**Created:** [January 10, 2025, 11:03pm UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052 "2025-01-10T23:03:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![retired\_guy](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@retired\_guy](https://forums.pimoroni.com/u/retired_guy)\
**Post date:** [January 10, 2025, 11:03pm UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052/1 "2025-01-10T23:03:31Z")

</div>

Per the docs:

```auto
rectangle(x, y, w, h, corners=(r1, r2, r3, r4), stroke=0)

```

But when I try this:

```auto
display.rectangle(30, 0, 420, 420, ((20, 20, 20, 10)), 1)

```

I get this error:  
function takes 5 positional arguments but 7 were given

When I try this:

```auto
display.rectangle(30, 0, 420, 420, corners=((20, 20, 20, 10)), stroke=1)

```

I get this error:  
function doesn’t take keyword arguments

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![retired\_guy](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@retired\_guy](https://forums.pimoroni.com/u/retired_guy)\
**Post date:** [January 11, 2025, 12:42am UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052/2 "2025-01-11T00:42:59Z")

</div>

Ah, I see. I’ve confused picographics and picovector. Same function names, different attributes. Working now.

---

<div class="post-metadata">

**Author:** ![alphanumeric](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/alphanumeric/32/2729_2.png) [@alphanumeric](https://forums.pimoroni.com/u/alphanumeric)\
**Post date:** [January 11, 2025, 8:15am UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052/3 "2025-01-11T08:15:01Z")

</div>

> [@retired\_guy](#):
>
> `display.rectangle(30, 0, 420, 420, ((20, 20, 20, 10)), 1)`

What happens if you try?  
display.rectangle(30, 0, 420, 420, (20, 20, 20, 10), 1)

I don’t own a Presto, just so you know.

---

<div class="post-metadata">

**Author:** ![SirFico](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@SirFico](https://forums.pimoroni.com/u/SirFico)\
**Post date:** [July 31, 2025, 11:05pm UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052/4 "2025-07-31T23:05:07Z")

</div>

> [@retired\_guy](#):
>
> Ah, I see. I’ve confused picographics and picovector.

Did you? I’ve just had the same when using the PicoVector graphics on my Presto, and the docs for the PicoVector clearly state “`rectangle(x, y, w, h, corners=(r1, r2, r3, r4), stroke=0)".`

I’m just getting going with the Presto and the picovector graphics which I’ve not used before. I’ve managed to construct a nice compass widget, got some buttons and touch working, and I then attempted to create some nice rounded corner buttons. But then hit the problem that was outlined in the op.

The doc’s on the presto regarding the picovector are somewhat sparse, and seemingly inaccurate which is a bit frustrating. A search of the Pimoroni repositories for picographics did not find a match.

Its not clear if @retired_guy actually did find a way to do rounded corners, and for tonight I’ve boggle eyed myself quite enough looking for any rounded rectangle examples in the Presto example programs. Anyone got rounded rectangles on the Presto? Maybe the way is to draw a polygon shape :(

---

<div class="post-metadata">

**Author:** ![retired\_guy](https://avatars.discourse-cdn.com/v4/letter/r/c67d28/32.png) [@retired\_guy](https://forums.pimoroni.com/u/retired_guy)\
**Post date:** [July 31, 2025, 11:27pm UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052/5 "2025-07-31T23:27:57Z")

</div>

I haven’t looked at it in a good while, but I think so. See lines 135-140 in main.py here:

> **[GitHub - retired-guy/WiiM-Presto: Display WiiM now playing on Pimoroni Presto](https://github.com/retired-guy/WiiM-Presto)**
>
> Display WiiM now playing on Pimoroni Presto

---

<div class="post-metadata">

**Author:** ![SirFico](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@SirFico](https://forums.pimoroni.com/u/SirFico)\
**Post date:** [August 1, 2025, 8:35am UTC](https://forums.pimoroni.com/t/presto-rectangle-with-curved-corners/27052/6 "2025-08-01T08:35:46Z")

</div>

Thanks @retired_guy , I see the way it works now. There were clues in the short doc on picovector but I got fixated with the display.rectangle that was ok for the square corners. Doh! Well now my buttons look much prettier. :)
