I am creating GUI using c# windows application program. I am quite new to this programming. I am trying to fill pictureBox with different colors based on some conditions.
I am trying to estimate the incoming quantity which is coming from the system. Initially I will set the expected volume of quantity is going to come(ucSample.Volume)from system, this will assign as a scale to pictureBox. This is working perfectly. I have certain conditions for estimating incoming quantity. I have one volume sensor which is going to give how much quantity already came from system(stored in variable "volume"). I am updating picture box every second. I have assigned color for each quantity.
for example: I have set estimated volume to "500"(ucSample.Volume=500), then i will start the system. System will pour the liquid slowly, it will take 30 mints for 100ml quantity to pour. When system pass liquid slowly at that time i will read the density, pressure, temperature of that liquid using sensors and checking which condition is met, according condition it will select one color. So i have one volume sensor which gives reading of volume which passed through system up to now. It will update every second, for example up to now the system passes only 10 ml liquid. So picture box has to update only up to 10 in the scale(scale of 500) with regarding color. Next suppose from 10 ml to 20 ml the incoming liquid changed so conditions will be different so now i need to fill pictureBox with different color from 10 ml to 20 ml scale. (not from 0 to 20ml), this should be like this, it won't need to change the color of previous one which is from "0 to 10 ml" keeping the same color and add different color from "10 to 20 ml". So the concept is i need to keep the previous one as it is and keep updating from the previous end point. i am updating every second.
So we don't know what is coming from system so finally after seeing pictureBox we have to estimate how much quantity (total) came from system and as well as individual quantity of each type. it is updating like first it will fill with "green" color from "0 to 100ml" and if quantity changed from 100 to 200 then it is filling with another color from "0 to 200 ml". (not from "100 to 200".) I am losing the previous information so it is totally wrong. I need to keep the initial color as it is up to how much it has already drawn before any changes in liquid then if any changes come it has to start from that point.
I hope i have given more clear explanation. Please help me if any one understand my concept.