I want to show some sensor measurements on the display. However it flickers everytime when it redraws the values.
The first text that is displayed doesn’t flicker, but all the others do, see the comments!
void barometer_MeasurementComplete(Barometer sender, Barometer.SensorData sensorData) //called every 100 milliseconds
{
double proportion = input.ReadProportion() * 1000;
display_T35.SimpleGraphics.ClearNoRedraw();
display_T35.SimpleGraphics.DisplayTextInRectangle("AAAA", 1, 1, 300, 10, GT.Color.White, Resources.GetFont(Resources.FontResources.NinaB)); // NOT FLICKERING AT ALL
display_T35.SimpleGraphics.DisplayText("BBBB: " + System.Math.Round(proportion).ToString(), Resources.GetFont(Resources.FontResources.NinaB), GT.Color.White, 1, 25); //FLICKERS A BIT
display_T35.SimpleGraphics.DisplayText("CCCC: " + System.Math.Round(sensorData.Temperature).ToString(), Resources.GetFont(Resources.FontResources.NinaB), GT.Color.White, 1, 35); // MORE FLICKERING
display_T35.SimpleGraphics.DisplayText("DDDD: " + System.Math.Round(sensorData.Pressure).ToString(), Resources.GetFont(Resources.FontResources.NinaB), GT.Color.White, 1, 45); // EVEN MORE
TimeSpan tmp = (DateTime.Now-started);
GT.Color color = GT.Color.Red;
if ((tmp - heattime).Ticks > 0)
color = GT.Color.Green;
display_T35.SimpleGraphics.DisplayText("EEEE " + (tmp.Days * 24 + tmp.Hours).ToString() + ":" + (tmp.Minutes).ToString() + ":" + tmp.Seconds.ToString(), Resources.GetFont(Resources.FontResources.NinaB), color, 1, 220); // FLICKERS VERY STRONG
display_T35.SimpleGraphics.Redraw();
}
How can I make this more smooth?