Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert BITMAP bytecount 24 to bytecount 8, grey background instead of white color

0 Kudos
1,868

Hi Gurus! Im trying to upload an image BMP to SE78 with white background color. Firstly I get the image with the methodif_cl_gui_gp_pres=>graphic_proxy~export (the image is a pie diagram painted like in program GFW_PROG_PIE)

CALL METHOD gp_inst->if_graphic_proxy~export
EXPORTING
format = if_graphic_proxy=>co_format_BMP
width = 50
height = 50
IMPORTING
*CONTENT_TYPE = S
content_length = lv_length
content = lt_bin_content
retval = retval.

When I´m trying to upload this image to SE78 with my program, all is ok but the background in the image is grey, I wan´t to upload the image with the white background, as I can see it in my PC if I download it.

To upload the image to SE78, I call the FM SAPSCRIPT_CONVERT_BITMAP_BDS passing my LT_BIN_CONTENT table (whitch has the graphic in line in type W3MIMETABTYPE = RAW 255) but inside this functiion, in the PERFORM FILL_BMFILE_FROM_BMP, I can see that my file has a bitcount 24 instead of 8 (To see the background white I need to get 256 color bitmap, not 16 million colors bitmap):

"Code inside the FILL_BMFILE _FROM_BMP

case bmp_bitcount.
when 1.
otf_bminfo-bmtype = c_itf_hex_bcol. "2 color
otf_bminfo-is_monochrome = c_false.
when 4.
otf_bminfo-bmtype = c_itf_hex_bcol. "16 color
otf_bminfo-is_monochrome = c_false.
when 8.
otf_bminfo-bmtype = c_itf_hex_bcol. "256 color
otf_bminfo-is_monochrome = c_false.
when 24.
otf_bminfo-bmtype = c_itf_hex_bcol. "16 million colors
otf_bminfo-is_monochrome = c_false.
when others. "16 or 32 bit true color
message e875 with bmp_bitcount raising bmperr_no_colortable.
endcase.

Is there any function, method or something to convert my bin tab to 256 colors? I need to do It inside SAP, not with Paint program.

Thank you .

4 REPLIES 4
Read only

MateuszAdamus
Active Contributor
0 Kudos
1,217

Hi soportefuncional.euskousuariopara

There is a Z* class for bitmap transformations in ABAP. Maybe it will help solve your issue.

https://blogs.sap.com/2007/09/05/abap-bitmap-image-processing-class/

https://code.google.com/archive/p/abap-sdn-examples-tpj/downloads

Regards,
Mateusz
Read only

0 Kudos
1,217

Hi, Thanks! how can I open the file of this class? I found this blog, but I can´t open the nugg files, or I don´t know how...

Read only

0 Kudos
1,217

Hi

You need to have the ZSAPLINK report on your system. Then you can upload the class using that report.

You can find it here: https://github.com/sapmentors/SAPlink

Regards,
Mateusz
Read only

0 Kudos
1,217

Hi! I´ve got it! I,m going to review the class, thank you so much!!