Hi all,
I'm working on new software for my project and one of the items is using a bargraph for displaying data.
I have created a macro that lets me print a nice bargraph with all the different ticks and stuff, and I can fill this bargraph nicely with data.
The only problem that I have is, when the value keeps adding up you can see that the bargraph is filling so that works. When this data is going down (-) then the filling of the bargraph should respond,
in the same way but I cannot get this to work Im a bit stuck here.
All calculations are commented so I think it is better to understand what Im doing.
I hope somebody can have a look ad this.
Regards Jordy
PS. the macro name of the bargraph action is Graphic_Bar
Glcd Bargraph Draw Problem
Moderator: Benj
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Glcd Bargraph Draw Problem
- Attachments
-
- Aa System FW-V1.0.fcfx
- (96.57 KiB) Downloaded 235 times
the will to learn, should not be stopped by any price
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: Glcd Bargraph Draw Problem
Hi Jordy,
You need to clear the area to the right of the bar yourself. Set the foreground color equal to the background color and draw the pixels between the bar and the end tick in this color (.BarInFill_Width to .Width-1). This will effectively erase the remainder of the old bar.
(Do not forget to set the color back to the drawing color before drawing anything else)
BTW, you could probably use DrawRectangle to draw the bar and (after setting the color) clear the remainder.
Jac
You need to clear the area to the right of the bar yourself. Set the foreground color equal to the background color and draw the pixels between the bar and the end tick in this color (.BarInFill_Width to .Width-1). This will effectively erase the remainder of the old bar.
(Do not forget to set the color back to the drawing color before drawing anything else)
BTW, you could probably use DrawRectangle to draw the bar and (after setting the color) clear the remainder.
Jac
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
- Jordy101091
- Posts: 519
- Joined: Sat Jan 08, 2011 4:02 pm
- Location: The Netherlands
- Has thanked: 25 times
- Been thanked: 188 times
- Contact:
Re: Glcd Bargraph Draw Problem
Thanks kersing for your quick answer,
I have got it to work now.
Regards Jordy
I have got it to work now.
Regards Jordy
the will to learn, should not be stopped by any price