Page 1 of 1

Bargraphs best methods

Posted: Sun Nov 22, 2020 7:02 am
by dood
Hi' everyone,

I'm working on a EVE project based on Arduino using the Rudolph lib (hello, me again :)).

As this is a dataloger for motorcycle, I would like to print a RPM bargraph.

I think about differents methods :
- Prepare a dozen tiny pictures (rectangles) and print some of them to show the RPM value
- Directly draw these rectangles with VERTEX2F command
- Draw a polygone form (empty) and fill it more or less (filling it from left to right).

Here is the first example I find to show you what I expect (not exactly, but that's the idea) :
Image

Does someone have any recommandations about this ?
Best or other solutions, pros/cons.

Re: Bargraphs best methods

Posted: Sun Nov 22, 2020 4:17 pm
by avanti
I often find it most efficient to directly write pixels into an image in RAM_G and display it as an image. You can draw anything you like and update it dynamically.

Re: Bargraphs best methods

Posted: Mon Nov 23, 2020 11:30 am
by Rudolph
Hmm, the "best" method would be something that is doable with the available resources while beeing pleasant enough to look at. :-)
Bridgetech has a fancy example code somewhere that has a round graph that is using a few tricks like scissors.

Or you could use a rectangle, that is just two points and one coordinate that is changing.
Combined with changing the color for the whole thing and putting a picture over it with alpha channel it could look a little fancy
while beeing highly efficent and mostly functional.

Functional, efficent, that is my cup of tea, fancy not so much.
Not because I do not apreciate fancy, it's more that I do not apreciate what I can do in regards of graphics design. :-)

Re: Bargraphs best methods

Posted: Fri Nov 27, 2020 12:57 am
by dood
Thanks to both of you.

It has to be a little bit fancy even if I'm clearly not the best with design, drawing or anything else close to that job :D

The rectangles thing looks pretty easy and with thin rectangles like 1 or 2 pixels width I should be able to get a smooth shape.
Writing pixels into an image ... why not ... I'll need to RTFM because I'm a EVE's beginner :)

I'll post pictures as soon as I get something nice (or not)

Re: Bargraphs best methods

Posted: Wed Dec 02, 2020 6:11 pm
by Henry
I ran across this


Re: Bargraphs best methods

Posted: Thu Dec 03, 2020 5:50 am
by dood
Very nice !
That's what I'm trying to do :)

Tell us a little bit more about that, what method did you use ?

Re: Bargraphs best methods

Posted: Thu Dec 03, 2020 10:47 am
by Henry
I didn't, I just found it, I would recommend reaching out to the author.

Re: Bargraphs best methods

Posted: Sat Dec 05, 2020 6:55 am
by dood
Oups I didn't pay attention.
He made available his example here : http://www.mediafire.com/file/x7im4ir7q ... X.rar/file

He uses rectangles method.