Thursday, June 29th 2017, 9:20am UTC+2

You are not logged in.

  • Login
  • Register

kenmux

Beginner

Date of registration: Jan 18th 2016

Posts: 33

1

Friday, June 9th 2017, 8:03am

Issue about BmpCvt.exe with 32bit bitmap

Hello all,

I tried to use BmpCvt.exe to convert a 32bit bitmap to c file.
I used the format "True color with alpha" which will set the draw function as "GUI_DRAW_BMP8888".
But the c file cannot be played properly: nothing showed but only a black screen.

I tried it in both pc simulator and my own board with the same result.
In addition, if I use format "True color 24bpp", all's fine.

The version of BmpCvt.exe I used is: v5.4.0.
I add an attachment of c file converted by BmpCvt.exe.
Any ideas? Thanks in advance.

Kenmux
kenmux has attached the following file:

This post has been edited 1 times, last edit by "kenmux" (Jun 9th 2017, 8:17am)


SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 309

2

Friday, June 9th 2017, 8:15am

Hi,

which device are you using and what is the color conversion (GUICC_xxx) in your LCDConf.c.

If the color conversion is GUICC_M8888I you have to save bitmaps as 'True color with alpha, r/b swapped, alpha inverted'. This would explain the black screen because of the inverted alpha channel. Any pixel which should be visible will invisible if the alpha channel doesn't fit to the color conversion.

Regards,
Sven

kenmux

Beginner

Date of registration: Jan 18th 2016

Posts: 33

3

Friday, June 9th 2017, 8:26am

Hello Sven,

The device I used is the board used in my project.
The lcd driver is proved okay & works very well.
I checked the LCD_CORLOR_CONVERSION again, and it's GUILCC_RGB8888.
You know there's also a format "True color with alpha, (Both variants)" in BmpCvt.exe.
Using this will go over the pits you mentioned, right?
And, it gave me the same result.

I also attached the 32bit bitmap.
Would you please help to test it?
Maybe the file's fault?
I've no idea at all.
Thanks in advance.

Kenmux
kenmux has attached the following file:

This post has been edited 1 times, last edit by "kenmux" (Jun 9th 2017, 8:30am)


SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 309

4

Friday, June 9th 2017, 9:39am

Hi,

I have found the issue. The problem is related to the Bitmap Converter. When loading an image without alpha channel (which is true for the .bmp file) the Bitmap Converter offers the possibility to save the image as 32bit per pixel. In this case it adds an alpha channel. Unfortunately, the alpha channel added to the pixel had the wrong value. In our case the alpha channel was 0xFF for every pixel which means transparent when using GUICC_8888.

There are two ways to get around of this.
First, convert the image into a format like png which has 32 bit per pixel, even transparency is not required, and then convert it with the Bitmap Convert.

Second, check your emails ;)

The fix will be released with the next emWin version.

Regards,
Sven

kenmux

Beginner

Date of registration: Jan 18th 2016

Posts: 33

5

Friday, June 9th 2017, 10:24am

Hello Sven,

Thanks for your reply!
So the reason is clear enough.
I'd like to have a direct way to solve it.


I'm glad to get the update.
Thanks for your info.

Kenmux

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 309

6

Friday, June 9th 2017, 4:57pm

Hi,

I have send you the file already.

Not sure if it is a good idea to post your email address publicly, so I have deleted it from your last post.

Regards,
Sven

kenmux

Beginner

Date of registration: Jan 18th 2016

Posts: 33

7

Monday, June 12th 2017, 4:30am

Hello Sven,

Thanks very much for your kindness!
I'm sorry I've found your email just now.
The gmail treated it as spam, and that folder hidden as default.
I tested with the latest version you provided, it's okay now!

Thanks,
Kenmux