Vertical rectangle

Hi
I am building a Function Generator, one of the features is a bar graph to monitor the output level. I can create a rectangle from left to right and use the data from an analog input and the fill command. What I want is a rectangle which is vertical. I can create a vertical rectangle , but the x,y coordinates are the top most corner and the rectangle extends down, so when I do a fill, its from the top down and what I need is to fill from the bottom up. Is there anyway to do this. Almost forgot, I am using Bodners tft_espi library
Regards

You can draw 2 rectangles - one for the empty top part and one for the filled in bottom part. The bottom is always filled in 100% and the top 0%.

What if you do, eg., display_y = lower_coord - y? :thinking:

Regards

Hi
thanks for your reply, I possible didnt explain clearly, what I need is a vertical rectangle, that with no output from the frequency gen ,is empty and progressively fills from bottom to top in relation to a rising analog input. While writing this, I have been experimenting , using the draw line command. As the x coord is the same, Ive made the y a variable and this seem to work. I drew 5 adjacent lines to get a thicker line. If the first item is not feasible , I will persue the latter.
Thanks

I got what you wanted. I am pointing out that what you are considering a partially filled single rectangle can be also seen as 2 rectangles in the vertical bar. One is at the bottom (the value) as a fully filled in rectangle and the other is an empty rectangle at the top for the other part to make 100% of the height. At the two extremes (0% and 100%), the height of the bottom and top rectangle respectively are just 0.

Your solution is similar to what I have just said using a different method (lines).

Thanks
I will digest all the info and experiment further.
Regards

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.