BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: BT815 custom font and image PIC MCU  (Read 617 times)

elektor18

  • Newbie
  • *
  • Posts: 8
    • View Profile
BT815 custom font and image PIC MCU
« on: July 31, 2019, 04:00:52 PM »

Hi All,

I struggling to load image and custom font from MCU to the display.

Font:
Code: [Select]
StartAddress2 = End_Address1;
API_LIB_WriteDataRAMG(DigitsFont, sizeof(DigitsFont), StartAddress2); 

    API_LIB_BeginCoProList();
    API_CMD_DLSTART();

    API_CLEAR_COLOR_RGB(0, 0, 0);
    API_CLEAR(1,1,1);
    API_BITMAP_HANDLE(15);
    API_BITMAP_SOURCE((StartAddress12+148)-(32*3*15));
    API_BITMAP_LAYOUT(L2,3,15);
    API_BITMAP_SIZE(NEAREST, BORDER, BORDER, 10,15); 
       
    API_CMD_SETFONT(15, StartAddress12);
    API_COLOR_RGB(255,255,255);
    API_CMD_TEXT(50,50,15,0,"HELLO");
    API_CMD_TEXT(50, 100, 15,0, "12:00");
    API_CMD_NUMBER(50,120,15,0,123);
         
    API_DISPLAY();
    API_CMD_SWAP();

    API_LIB_EndCoProList();
    API_LIB_AwaitCoProEmpty();

But it look like this part is overwriting my other images (I think so)?

Logged

BRT Community

  • Administrator
  • Full Member
  • *****
  • Posts: 130
    • View Profile
Re: BT815 custom font and image PIC MCU
« Reply #1 on: August 05, 2019, 10:08:12 AM »

Hello,

Please have a look at the following application note, this has an example of loading a custom font and an image concurrently:
https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/BRT_AN_014_FT81X_Simple_PIC_Library_Examples.pdf

Best Regards,
BRT Community
Logged

elektor18

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: BT815 custom font and image PIC MCU
« Reply #2 on: August 09, 2019, 08:59:59 AM »

Hi,

I can't see any good example to be honest.
So maybe once again, I want to load images and custom font to next available space in memory. How to calc needed space to avoid data corruption. PROPS command is good to get image data (x,y,w,h) or easy to check it size but what  about custom fonts?   
Logged

BRT Community

  • Administrator
  • Full Member
  • *****
  • Posts: 130
    • View Profile
Re: BT815 custom font and image PIC MCU
« Reply #3 on: August 12, 2019, 11:29:26 AM »

Hello,

Is the font compressed or non-compressed?

If its non compressed you can check the size of the data array for the font that's been written to RAM_G.

Best Regards,
BRT Community
Logged

elektor18

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: BT815 custom font and image PIC MCU
« Reply #4 on: August 14, 2019, 11:13:07 AM »

It is not compressed and in L2 format. I tried get size in the same way as I did it with other images but for some reason it doesn't work. But if you saying it should be the same, I will analyse my code again (I did it 100 times anyway) and maybe I will spot mistake, if not, I will be back  ;)
Logged

pauljiao

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: BT815 custom font and image PIC MCU
« Reply #5 on: September 04, 2019, 03:11:03 AM »

Bitmap Handle 15 is a scratch handle used by Eve built-in widget. See programming guide 5.66 cmd_setscratch.

I suggest to use other bitmap handle , 0 to 14 and see if it works.

Logged