How to draw Rounded corner rectangle as per given image sample?

can you please let me know how to create button like given image. when i click it will fill the color on selected item. here is the sample what i want. i am new in juce. Please share code if you have for great help.

Look here >

i got the function from the class. But how to set in my class with which component? Actually i am newbie in Juce sir so Please help me

if you are not able to extrapolate the Path generation and stroke/filling in that function i posted and adapt it to make it work in your own Component paint method, you’d better start off with something simpler then…

okay i will try and start with basic draw function. If you have any sample to learn it then let me know. Actually i dont know the c++. I am learning juce and try to desing UI for mobile app

Sir i have tried using the given method but able to whole button rectangle. I want to draw half portion filled and half without fill color. can you please help me for this

Take a look at the graphics tutorials:

And then look at the graphics class reference:

Within that you will probably need a drawRoundedRectangle, fillRoundedRectangle and a fillRectangle to make that shape.

Also, you should probably learn some basic c++ before trying JUCE.