1

I'm trying to draw a rounded rectangle with transparency with the library Skia.

I get a perfect result if i'm using overlapping without transparency.

But when i'm using transparency, i get this:

overlapping1

That's what i get when i do not overlap:

gaps

Even if i modify the radius of the inner rectancle, there're still some overlaps/gabs.

My questitons:

  • What is the correct way to caluclate the radius of the inner rectangle, when i can accept some missplaced pixels?
  • Is there another way?
Arakis
  • 849
  • 5
  • 16

1 Answers1

0

You can use saveLayerAlpha before drawing and then restore after drawing. This allows you to draw multiple paths, shapes, etc with a "global" alpha applied to the layer.

matanube
  • 407
  • 3
  • 11