# Cannot clip a path that contains a round rectangle?

**URL:** <https://forum.xojo.com/t/cannot-clip-a-path-that-contains-a-round-rectangle/83499>\
**Category:** Windows\
**Created:** [December 6, 2024, 9:23am UTC](https://forum.xojo.com/t/cannot-clip-a-path-that-contains-a-round-rectangle/83499 "2024-12-06T09:23:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulrich\_Bogun](https://forum.xojo.com/user_avatar/forum.xojo.com/ulrich_bogun/32/1864_2.png) [@Ulrich\_Bogun](https://forum.xojo.com/u/Ulrich_Bogun)\
**Post date:** [December 6, 2024, 9:23am UTC](https://forum.xojo.com/t/cannot-clip-a-path-that-contains-a-round-rectangle/83499/1 "2024-12-06T09:23:37Z")

</div>

I am working on a very graphical UI where a lot of design is done in a background canvas’ paint event.  
As I need to draw a picture on a gradient pane that has round rectangle corners, I use this snippet to make it not overlap:

```auto
var clip As New GraphicsPath
clip.AddRoundRectangle MenuWidth, 0, g.Width - menuwidth, g.Height, 60/ScaleFactor, 60/ScaleFactor
g.SaveState
g.ClipToPath(clip)

```

Works nicely on macOS. Does not work at all on Windows, where I run into an

> UnsupportedOperationException: Cannot clip path that includes a RoundRectangle.

Docs do say ClipToPath is not available on console or web apps, but this is a desktop app. A Xojo or a documentation bug?

---

<div class="post-metadata">

**Author:** ![RudolfJ](https://forum.xojo.com/user_avatar/forum.xojo.com/rudolfj/32/644_2.png) [@RudolfJ](https://forum.xojo.com/u/RudolfJ)\
**Post date:** [December 6, 2024, 11:57am UTC](https://forum.xojo.com/t/cannot-clip-a-path-that-contains-a-round-rectangle/83499/2 "2024-12-06T11:57:40Z")

</div>

156 / 5.000  
I always use PixMapshaptes to draw pictures in different sizes and shapes. These can also be rotated and scaled  
also under Window11

```auto

```

Var bild As New Picture(300,300)  
bild.Graphics.DrawPicture mypict,0,0,300,300,0,0,mypict.Width,mypict.Height  
Var maske As picture  
maske = bild.copymask  
maske.Graphics.ClearRectangle(0,0,300,300)  
maske.Graphics.drawingcolor = Color.Black  
maske.Graphics.FillRoundRectangle(0,0,300,300,50,50)  
bild.ApplyMask(maske)  
px = New PixmapShape(bild)

```auto

```
