Main Site Documentation

LCD speed


#1

Just to get a feel for the speed of the LCD (7") I tried this code:

 Debug.GC(true);
                    
                    {
                        int LL;
                        Font fonty = Resources.GetFont(Resources.FontResources.calibri32);
                        Bitmap LCD1 = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
                       
                        for (LL = 0; LL <=100; LL = LL + 1)
                      
                        {
                            LCD1.DrawRectangle(Colors.Orange, 4, 100, 100, 200, 300, 0,0 , Colors.Orange, 0, 0, Colors.Orange, 0, 0, Bitmap.OpacityOpaque);   
                            LCD1.DrawTextInRect("YOU WILL SEE A GREAT THING "+LL.ToString()+ " NOW" , 100, 100, 200, 300, Bitmap.DT_AlignmentCenter | Bitmap.DT_WordWrap, Colors.Blue, fonty);
                            LCD1.Flush();
                        }
                        return;

It takes about 15 seconds to go through all 100 counts (note there are no delays or waits) …seems a bit slow…Any thoughts for a speed up?


#2

6FPS is OK for Cobra with 7" LCD…


#3

I think DrawTextInRect is pretty time consuming.
You could draw the entire screen just once, then clear and update only the region where the count would be. This would need some pre math.