11-21-2022 10:12 AM
I am using CL_GUI_HTML_VIEWER to display an image (using an URL) in GUI. The image is displayed within a black frame inside the container (CL_GUI_CUSTOM_CONTAINER).
Does anyone know how to control the size of the image in the container (e.g. how to stretch the image to fit the container) or how to control the frame (width and colour of the frame)?
11-21-2022 10:29 AM
Hi csaba.szommer,
I would personally play with CSS to set up background color of your HTML content.
You could set the width / height of your image using widht / height attributes in the IMG tag.
Please remember that you should specify either width or height as you might be interested in keeping the original ratio of the image.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
html {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
background-color: #ffffff;
color: #000;
}
</style>
</head>
<body>
<div class="wrapper">
<img src="SOMEIMAGE.JPG" width="100%" />
</div>
</body>
</html>
Regards,
Bartosz
11-21-2022 10:29 AM
Hi csaba.szommer,
I would personally play with CSS to set up background color of your HTML content.
You could set the width / height of your image using widht / height attributes in the IMG tag.
Please remember that you should specify either width or height as you might be interested in keeping the original ratio of the image.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
html {
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
background-color: #ffffff;
color: #000;
}
</style>
</head>
<body>
<div class="wrapper">
<img src="SOMEIMAGE.JPG" width="100%" />
</div>
</body>
</html>
Regards,
Bartosz
11-21-2022 10:41 AM
Hi Bartosz,
thanks a lot for your reply.
I meant to control the display of the image within ABAP using the mentioned class. If it is not possible, I will have to "wrap" it as you suggested but I would like to avoid that.
11-21-2022 12:30 PM
Please use the COMMENT button for comments, asking for complements, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.
I mean, instead, post a comment under ziolkowskib answer.
CL_GUI_HTML_VIEWER is about displaying HTML/CSS content and more, so Bartosz is explaining you how to stretch the image, but I guess you need to make clear what HTML and CSS are, right?