Skip to Content
-1

How to erase a image from the screen dynamically.

Oct 18, 2017 at 04:41 AM

50

avatar image
Former Member

Hi..

I wanted to know how to erase a picture displayed in the screen dynamically.

I am displaying a picture in the screen using container. When I press a button picture will be displayed on that container. But if i press the button for the second time , Pictures displayed will be overlapped , and creates problem while scrolling. One of the image remains fixed , and another moves along with the scrolling bar.

Please help me to solve this problem.

Thank you...

10 |10000 characters needed characters left characters exceeded

Please tell us how you display a "picture using container"? Which class for the image? Which type of container?

Could you please attach a screen capture too, because I don't understand how the scrollbar with one fixed image and one normal image look like?

0
Former Member

class for image : CL_GUI_PICTURE

container : type ref tocl_gui_custom_container.

I am trying to display 3 images in a subscreen which has a scroll bar.

1
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Krishna Murthy Oct 18, 2017 at 05:03 AM
1

hi can u follow below steps

1.when button clicked:

under button action perform free object of picture and container.

2. where pbo of screen to display picture.

create every time objects of container and picture.

use method of CL_GUI_PICTURE is like below

CALL METHOD GO_PIC1->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.

then u can get dynamic display of picture

Show 5 Share
10 |10000 characters needed characters left characters exceeded

here i am giving sample code.

PBO.

DATA:LV_STATE TYPE I.

IF <CON_OBJ> is not initial.

LV_STATE = <CON_OBJ>->IS_ALIVE( ).

ENDIF.

check LV_STATE < 0 or <CON_OBJ> is initial.

<write here container object creation>

<write here picture object creation>

CALL METHOD <PIC_OBJ>->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.

PAI.

IF SY-UCOMM = '<BUTTON ACTION>'.

<PIC_OBJ>->FREE( ).

<CON_OBJ>->FREE( ).

ENDIF.

0
Former Member

Thanks a lot...This method works perfect for a single picture.

But in my case I am displaying 3 pictures in the screen using 3 different picture object and single container object.

Now only the 3rd picture is getting erased , whereas 1st and 2nd picture get overlapped with a empty picture. Is there any other solution other than creating 3 separate containers for 3 pictures.

I also wanted to know what is the difference between clear and free in this case.

Thank you.

0

use 3 different containers to display.

0

and 3 different pic objects to display pic

0
Former Member

Thank you..

Its working fine...

0
Raymond Giuseppi
Oct 18, 2017 at 05:50 AM
1

In the PBO, when the picture must be changed or removed you can use the method clear_picture before calling set_display_mode and the required load_picture_from_* method

Share
10 |10000 characters needed characters left characters exceeded