Hi,
I have been doing some tests to get used to the HDMI component and it does not seem to be working as it should.
First off I could not change the background colour, I have given that a miss for now but do not like the yellow it seems to default to.
I then started looking at positions, font and colours. The positions seem to be fine but the colours are not, see image.
Red does not appear to do anything.
Green shows up as red?
Blue works fine.
Combinations also do not appear to work, in the test I tried purple (red/blue) and it still looked blue. Light blue shows as white.
The first numbers are x/y position, then the colour it should be and the RGB values.
I also tried different fonts which did not seem to work but that could be me so I will look it up a bit more first.
Regards,
Bob
Pi HDMI component colours are not right
-
- Posts: 334
- http://meble-kuchenne.info.pl
- Joined: Sat Mar 19, 2022 4:53 pm
- Has thanked: 32 times
- Been thanked: 33 times
-
- Valued Contributor
- Posts: 1677
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 373 times
- Been thanked: 581 times
Re: Pi HDMI component colours are not right
Hi Bob
No access to hardware to check (travelling just now) but could it be an issue with R/G/B positions? It appears above that Blue is correct so maybe Red and Green are mixed up giving you G/R/B instead...???
Maybe try 200/0/0 for Green and 0/255/0 for Red (using values from above) to check?
Regards
No access to hardware to check (travelling just now) but could it be an issue with R/G/B positions? It appears above that Blue is correct so maybe Red and Green are mixed up giving you G/R/B instead...???
Maybe try 200/0/0 for Green and 0/255/0 for Red (using values from above) to check?
Regards
-
- Valued Contributor
- Posts: 486
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 83 times
- Been thanked: 260 times
Re: Pi HDMI component colours are not right
The component was developed back in the days of 32 bit OS. I suspect that now with 64 bit the colour depth has increased. I'll have a play when I next get chance 

Re: Pi HDMI component colours are not right
Hi,
I tried reversing red/green and probably worse as one text did not show at all.
I am going to try with a 32 bit OS now, will let you know how it went later.
Regards,
Bob
I tried reversing red/green and probably worse as one text did not show at all.
I am going to try with a 32 bit OS now, will let you know how it went later.
Regards,
Bob
-
- Valued Contributor
- Posts: 486
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 83 times
- Been thanked: 260 times
Re: Pi HDMI component colours are not right
Thanks.
I was nearly correct
I've just run it in debug mode (set 1 in the debug macro) and my setup reports 16 bits per pixel.
That's a lower colour depth than the code assumes.
The plot continues...
I was nearly correct
I've just run it in debug mode (set 1 in the debug macro) and my setup reports 16 bits per pixel.
That's a lower colour depth than the code assumes.
The plot continues...
-
- Valued Contributor
- Posts: 486
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 83 times
- Been thanked: 260 times
Re: Pi HDMI component colours are not right
Just had a quick look at the component, and it looks like it uses the same colour encoding for the Raspberry Pi target code as for the simulation code, namely 32 bit colour depth and 8 bits for the individual colours. I think the Pi frame buffer (16 bpp) should be RGB565 format.
edit: Ah, silly me, these are editable property fields in the component
Change them to 16, 5, 6, 5 and all will be well
edit: Ah, silly me, these are editable property fields in the component

Change them to 16, 5, 6, 5 and all will be well

Re: Pi HDMI component colours are not right
Hi,
Thanks for all your help, it works a treat. The green looked black at 200 but at 255 it is fine. I have noticed you can change the background default there as well.
Hopefully the change background function will work now as well.
Bob
Thanks for all your help, it works a treat. The green looked black at 200 but at 255 it is fine. I have noticed you can change the background default there as well.
Hopefully the change background function will work now as well.
Bob
-
- Valued Contributor
- Posts: 486
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 83 times
- Been thanked: 260 times
Re: Pi HDMI component colours are not right
Yes, background colour is a common trap
You need to remember that SetColour just changes the "ink" for the next drawing operation.
So after SetBackgroundColour you need a ClearScreen

You need to remember that SetColour just changes the "ink" for the next drawing operation.
So after SetBackgroundColour you need a ClearScreen
Re: Pi HDMI component colours are not right
Thanks, without that info I would have been caught out yet again, this is why I think there should be examples as I would not have had to ask so many questions.
I have progressed quite well now but having a bit of a problem with PrintNumber, if I put in 12345 it prints as expected, if I then use a variable (still INT) and put the number as it's start value that works. I am not sure if the variable has to be INT as it accepts Long or UINT but if I put a fixed value of 45678 (UINT) or 123456789 (Long) it shows a negative value so I am sticking with INT although that seems a bit of a limitation.
Then there is a problem when trying to display a count IE TestValue = TestValue + 1 and then display TestValue, all I get is a strange couple of characters.
Going to need a few beers to try to narrow the problem down.
Bob
I have progressed quite well now but having a bit of a problem with PrintNumber, if I put in 12345 it prints as expected, if I then use a variable (still INT) and put the number as it's start value that works. I am not sure if the variable has to be INT as it accepts Long or UINT but if I put a fixed value of 45678 (UINT) or 123456789 (Long) it shows a negative value so I am sticking with INT although that seems a bit of a limitation.
Then there is a problem when trying to display a count IE TestValue = TestValue + 1 and then display TestValue, all I get is a strange couple of characters.
Going to need a few beers to try to narrow the problem down.
Bob