Digole
©DIGITAL
SOLUTIONS

Serial Display emulator    New Display User manual

Forum login or
Login:
Password:
  
Forum Catagory
Digole Serial Display (210)
  12864 LCD/OLED module (23)
  24064 LCD module (3)
  Color LCD Modules (29)
  Color OLED module (20)
  Online Emulater (5)
  Universal GLCD module (1)
  Universal Text LCD module (2)
Mini Display Panels (0)
  Mini LCDs (0)
  Mini OLEDs (0)
Pattern Drive Module (0)
~Buy & Sell on Digole (2)
~Others~ (5)
Forum : Digole Serial Display :

 Search Forum.. 
 Creat New Topic   Reply 

Speed

Is there any way to increase drawing speed? I'm using the 320x240 IPS touchscreen, and drawing even a small filled rect (FR) is very slow, and not usable for quickly drawing UI elements between screens.

RE:Speed

If you need a filled rectangle, use drawing window, then clear the drawing window with a back ground color, it is faster than regular filled rectangle function.

Rectangle function is operated pixel by pixel, and also affected by the line pattern, but clearing draw window only fill the memory with special value, so, it should be faster.

RE:Speed

 That's much faster, thanks!

RE:Speed

Hello,

I would also like to use this function! Can you please post this code example here? Please!!!!

Thank you very much!

RE:Speed

 
 
#define LCDWidth 240  //define screen width,height
#define LCDHeight 320
 
#define _Digole_Serial_I2C_  //To tell compiler compile the special communication only, 
//#define TOUCH_SCEEN   //if the module equipt with touch screen, use this, otherwise use // to disable it
//#define FLASH_CHIP    //if the module equipt with 2MB or 4MB flash chip, use it, otherwise  use // to disable it
#define V33           //if the version of firmware on display is V3.3 and newer, use it
//all available are:_Digole_Serial_UART_, _Digole_Serial_I2C_ and _Digole_Serial_SPI_
 
//end changing
 
//define 8 bit color, see:https://en.wikipedia.org/wiki/8-bit_color
#define WHITE 0xFF
#define BLACK 0
#define RED 0xE0
#define GREEN 0x1A
#define BLUE 0x03
//define draw window
#define DW_X 5
#define DW_Y 8
#define DW_W (LCDWidth - 10)
#define DW_H (LCDHeight - 15)
#include <DigoleSerial.h>
//--------UART setup
#if defined(_Digole_Serial_UART_)
DigoleSerialDisp mydisp(&Serial, 9600); //UART:Arduino UNO: Pin 1(TX)on arduino to RX on module
#endif
//--------I2C setup
#if defined(_Digole_Serial_I2C_)
#include <Wire.h>
DigoleSerialDisp mydisp(&Wire, '\x27'); //I2C:Arduino UNO: SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5 on UNO and Duemilanove
#endif
//--------SPI setup
#if defined(_Digole_Serial_SPI_)
DigoleSerialDisp mydisp(8, 9, 10, 11); //SPI:Pin 8: data, 9:clock, 10: SS, 11:SI. you can assign 255 to SS, and hard ground SS pin on module
#endif
 
int x,y,r,r1;
 
void setup() {
  mydisp.begin(); //initiate serial port
  draw_Filled_Rectangles_Fast();
}
void draw_Filled_Rectangles_Fast(void)
{
    mydisp.cleanDrawWindow(); //clear draw window use the new back ground color
  mydisp.setRotation(0);
  mydisp.drawStr(0, 0, "Draw filled rectangle use draw window");
  for (i = 0; i < 20; i++)
  {
#ifdef V33
    mydisp.setBgColor(random(256));
#else
    mydisp.setColor(random(256));
 
    mydisp.setBgColor();
endif
    x = random(15, DW_W - 10);//top-left position
    y = random(DW_H - 10);
    r = random(DW_W - x);//width
    r1 = random(DW_H - y);//height
    mydisp.setDrawWindow(x, y, r, r1); //draw a filled rectangle:x,y,width,height
    mydisp.cleanDrawWindow(); //clear draw window use the new back ground color
  }
}
 

 

Copyright Digole Digital Solutions/Digole Technologies Inc., 2008-2024. All rights reserved.
Powered by Digole