2020-06-08 02:55 AM
2020-06-09 12:00 AM
Hello,
You can do that by using an image editor (paint.net, photoshop, gimp) -> create a rectangle with round corners -> save the image as png (so that alpha is included) -> import this image in your touchGFX project and use the Image widget to add it to your screen.
/Alexandre
2020-06-09 12:03 AM
Sorry, I need it at run time by coding.
2020-06-09 12:26 AM
Hello,
You can display the rectangle at run time whenever you want in the app. Just do rectangleImage.setVisible(true) when needed.
What do you want to do ?
/Alexandre
2020-06-09 12:29 AM
Sorry, I need to draw rectangle with 4 round corner, with different size specified at run time.
2020-06-09 01:06 AM
Hello,
This is high level graphics programming and we don't have an example for it right now.
We will consider creating one.
/Alexandre
2020-06-09 01:07 AM
Yes, hope you can release an example soon.
I have a lot of needs of different size, that require a rectangle as a background image. And png file is too expensive in code space.
I checked existing widget and example, but failed.
2020-06-09 01:23 AM
If it's a background image, why do you need round corners ? I'm still lost on what you are trying to do exactly as a project.
/Alexandre
2020-06-09 03:32 AM
Should not be too difficult to program it yourself.
I'm glad that TouchGFX is not full of bloatware to keep it light.
If you do this feature, please add it to open repository:
https://github.com/touchgfx/touchgfx-open-repository/tree/master/widgets
2020-06-10 03:31 AM
You could simply use a box, and then have corners with alpha in some sizes to create the rounded corners. Depending on what you're doing you may experience performance issues since we cannot use ChromART to draw the kind of shape you're after.
/Martin