View previous topic :: View next topic |
Author |
Message |
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Wed Nov 27, 2024 2:28 am Post subject: Converting to BGC programs |
|
|
Hello.
Is there any converter program for making BGC files other than MCS LCDconvert and Mrshilov exe and TPL plugin?
Today I was trying to convert 200x200 pixels monochromatic black & white QR code for TFT display.
Files generated by plugin or standalone exe dont work.
MCS LCDconvert have limitation to 132x132 pixels. So I resize my QR code and BGC generated by MCS programm works fine.
So I test the plugin once again with this 132x132 BMP. Unfortunately BGC not working again so this must be some problem to convert only black & white QR code.
I generate with success 180x240 BGC with this plugin from some pictures so it working for "coloured" fine.
Author wrote: "Has better compression than LCDconvert (about 25% depending to picture content)" so maybe here is some issue.
Maybe this will be not such more resources needed for extend the resolution of MCS LCDconvert. Byte 255x255 will be sufficient
It's not in a rush. QR code 132x132 scans fine on ILI9341 with smartphone and it shows links etc.
(BASCOM-AVR version : 2.0.8.6 ) _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 6118 Location: Holland
|
Posted: Wed Nov 27, 2024 3:05 pm Post subject: |
|
|
i will have a look at it. should be no problem _________________ Mark |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 6118 Location: Holland
|
Posted: Sat Nov 30, 2024 11:54 am Post subject: |
|
|
attached an update. hope it works. _________________ Mark
Last edited by albertsm on Sun Dec 01, 2024 12:51 pm; edited 1 time in total |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Sun Dec 01, 2024 10:13 am Post subject: |
|
|
Unfortunately it dont want to cooperate with me. I make a QRcode with link to this topic because I found this funny. So I make even divided by 8 file 224x224pix. Not working. Maybe I must look at the display routine.
I want to investigate it deeper so I rezize this 224x224pix image into 132x132 but then.... previous LCDconvert dont work anymore
I must find this entry first. Dont know yet if this is in the registry or some AppData.
Here is the not working QRcode for my tests. _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 6118 Location: Holland
|
Posted: Sun Dec 01, 2024 12:51 pm Post subject: |
|
|
sorry, i see that i did not change another part. too hasty
i will check it with the image you attached and do a new upload _________________ Mark |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 6118 Location: Holland
|
Posted: Tue Dec 03, 2024 9:10 pm Post subject: |
|
|
a new version. i tested it but not the generated bgc files since i have not such a display. _________________ Mark
Last edited by albertsm on Wed Dec 04, 2024 10:04 am; edited 1 time in total |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Tue Dec 03, 2024 9:34 pm Post subject: |
|
|
It genarate BGC files that dont work for me. Screenshot attached.
Maybe I can reach the nowledge what to clean to run the old LCDconvert again because it is not working anymore. _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 6118 Location: Holland
|
Posted: Tue Dec 03, 2024 9:58 pm Post subject: |
|
|
in the registry you find
\Software\MCS\LCDTOOL\
just remove the key and values.
odd that it does not work. i only increased the size.
so let me know if the old one works.
normally i would write an lcd emulator to check the output but i have little time.
the format is well know. i only wonder : this tool is for color lcd data with r,g,b.
it creates bgc not bgf. _________________ Mark |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Tue Dec 03, 2024 10:19 pm Post subject: |
|
|
I can run regedit.exe with Admin rights on this machine but CTRL+F needs some more info because \Software\MCS\LCDTOOL\ find nothing.
[EDIT] Sorry it start findig when searchig is narrowed into LCDTOOL (Maybe it is OS dependant)
[EDIT2] Yes, delete this entry enabless the launch of the old LCDconvert. _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 337 Location: Japan
|
Posted: Wed Dec 04, 2024 3:02 am Post subject: |
|
|
In my library, I was able to convert and display 224x224_332.jpg using [LCDconvert V2].
However, when I open a BMP file that I could open with the older version, the new [LCDconvert V2] does not display the image on the mesh screen.
In addition, when I start the older version of [LCDconvert.exe] after starting [LCDconvert V2], the following error message appears.
I'm not quite sure how to fix it. |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Wed Dec 04, 2024 5:05 am Post subject: |
|
|
@O-Family
WindowsKey+R ->
then input "regedit.exe" ->
mark the main tree ->
CTRL+F and input "LCDTOOL" ->
delete first find at YourMachine\HKEY_CURRENT_USER\SOFTWARE\MCS\BASCOM-AVR
"old" previous converter should work now
BTW. QR code works better on screen cleared into white - not black - tested. _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
O-Family
Joined: 23 May 2010 Posts: 337 Location: Japan
|
Posted: Wed Dec 04, 2024 5:54 am Post subject: |
|
|
Which files will I delete?
I'm afraid of manipulating the registry, so if the BMP for [LCDconvert V2] is fixed, will this deletion be unnecessary? |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Wed Dec 04, 2024 6:01 am Post subject: |
|
|
Im familiar with regedit so sometimes i know where not to manipulate but you can -> File Export before do something then -> File Import to restore changes
Simply mark with the Right Mouse Click whole folder like LCDTOOL never exists on your machine.
Normally, programms if not find previous entry, generates their own. _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 6118 Location: Holland
|
Posted: Wed Dec 04, 2024 10:05 am Post subject: |
|
|
here is a fix for the bmp.
@EDC HKEY_CURRENT_USER\SOFTWARE\MCS\BASCOM-AVR is not the key to delete since it is for bascom. but in general keys and data are recreated.
You already found out but one of your posts of this thread mentions it. so best to remove or update.
Nice to have QR code on LCD. Of course when there is enough interest the converter tool could create a QR too. _________________ Mark |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 1085
|
Posted: Mon Dec 09, 2024 2:15 am Post subject: |
|
|
Okay. I have some new info.
I resolve the mystery of BGC issue on QR codes.
Strange is that now new and previous LCDconvert.exe generates files that contains only 5 first bytes SizeX, SizeY , ImagesizeWord and &H00
If you want to know how registry entrys differs so after run the new one previous dont work anymore then here is the comparison on screenshot.
I do some investigation on decoding the BGC and found that routines used in the libraries of H Kipnik and then Netzman dont take an account that value of &HAA can be also a pixel value if repeats are set to zero.
ASM library of O-family do this but it is bit-bang SPI where I want to use hardware SPI for that (and also Xsize+Offset can be >255).
So I rewrite my routine that was previously tuned for AVRX family.
This is how it look:
Code: | Sub Lcd_pic_bgc(byval Xoffset As Word , Byval Yoffset As Word)
Local Ysize As Word , Xsize As Word , Imagesize As Word
Local L As Word , Pixel As Byte , Repeat As Byte
Local Color_l As Byte , Color_h As Word
Local Value As Byte , Rle As Byte , Rgb16 As Word , Repeats As Byte
Read Pixel 'Read the first 4 bytes from the BGF, this contains info about the image
Ysize = Pixel + Yoffset
Ysize = Ysize - 1
Read Pixel
Xsize = Pixel + Xoffset
Xsize = Xsize - 1
Read Imagesize
Color_l = Xoffset
Color_h = Xsize
Debug "X1=" ; Color_l ; " Y1=" ; Yoffset ; " X2=" ; Color_h ; " Y2=" ; Ysize ; " SIZE=" ; Imagesize
Lcd_set_window Color_l , Yoffset , Color_h , Ysize
Startpoint1: 'if we do some repeats then we back here for new
Read Value 'read first value
Startpoint2:
Read Rle 'read second '
'check if we must repeat somethig (AA means that if next byte <>0
If Rle <> &HAA Then 'no, we must show this byte and read new
Rgb16 = Rgb8to16(value)
Color_h = High(rgb16)
Color_l = Low(rgb16)
Lcd_databyte = Color_h : Lcd_write_data 'Write the pixel data to the display
Lcd_databyte = Color_l : Lcd_write_data
Value = Rle 'save readed value because nex byte can be AA
Decr Imagesize : If Imagesize = 0 Then Goto Exit_this
Goto Startpoint2 'back for one byte only
Else
'RLE=AA so we must know how many bytes repeat
Read Repeats
Rgb16 = Rgb8to16(value)
Color_h = High(rgb16)
Color_l = Low(rgb16)
If Repeats > 0 Then
Imagesize = Imagesize - Repeats
Do
Lcd_databyte = Color_h : Lcd_write_data 'Write the pixel data to the display
Lcd_databyte = Color_l : Lcd_write_data
' Decr Imagesize 'done once above by "Imagesize = Imagesize - Repeats"
Decr Repeats
Loop Until Repeats = 0
Else 'after AA is 0 (AA must be shown)
Rgb16 = Rgb8to16(value)
Color_h = High(rgb16)
Color_l = Low(rgb16)
Lcd_databyte = Color_h : Lcd_write_data 'Write the pixel data to the display
Lcd_databyte = Color_l : Lcd_write_data
' Value = Rle 'save readed value because nex byte can be AA
Decr Imagesize : If Imagesize = 0 Then Goto Exit_this
Goto Startpoint2 'back for one byte only
End If
If Imagesize = 0 Then Goto Exit_this
Goto Startpoint1 'back to top for two new values and skip used AA
End If
Exit_this:
End Sub |
Now even BGC generated by plugin works fine what is proven by next screenshot from my phone
So no rush but this is odd that LCDconvert generates only 5 bytes file (tested with BMP 24bit, BMP 1 bit and JPG). _________________ Check B-Flash -my MCS bootloader app for Android (updated) |
|
Back to top |
|
|
|