# requestRender last image can not deleted

**URL:** <https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076>\
**Category:** Technical Support\
**Created:** [April 28, 2022, 6:17am UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076 "2022-04-28T06:17:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![guankai](https://forum.microej.com/letter_avatar_proxy/v4/letter/g/d9b06d/32.png) [@guankai](https://forum.microej.com/u/guankai)\
**Post date:** [April 28, 2022, 6:17am UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076/1 "2022-04-28T06:17:21Z")

</div>

I want to achieve a dynamic effect through multiple pictures, but in the process of using it, I found that when the display performs requestRender, the previous picture will not be deleted. How can I clear the previous picture when rendering  
 ![bat3](https://forum.microej.com/uploads/default/original/1X/1381102f912ed37d0b283b66705e6b83bd76c55c.png)  
 ![bat4](https://forum.microej.com/uploads/default/original/1X/4351d0dbb50529c4ab4ee917c0f7e65613a85f3d.png)

---

<div class="post-metadata">

**Author:** ![thomas.pons](https://forum.microej.com/user_avatar/forum.microej.com/thomas.pons/32/133_2.png) [@thomas.pons](https://forum.microej.com/u/thomas.pons)\
**Post date:** [April 28, 2022, 3:19pm UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076/2 "2022-04-28T15:19:24Z")

</div>

Hi guankai,

I am not sure what effect you are trying to achieve. I guess that you want to have one blue image displayed at a time and all others images are grey, is that right? Like below?  
 ![4351d0dbb50529c4ab4ee917c0f7e65613a85f3d](https://forum.microej.com/uploads/default/original/1X/d8d68a259989165e107ccc583e0a87cf33d7f5c1.png)

Would you share the rendering code?

Thank you,  
Thomas

---

<div class="post-metadata">

**Author:** ![guankai](https://forum.microej.com/letter_avatar_proxy/v4/letter/g/d9b06d/32.png) [@guankai](https://forum.microej.com/u/guankai)\
**Post date:** [April 29, 2022, 1:57am UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076/3 "2022-04-29T01:57:58Z")

</div>

Hi Thomas  
It may be that the example I gave is not clear enough. I will change it to another example, as shown in the figure, I use these pictures to represent the oil amount of the car. When the oil amount is reduced to the specified value range, I will replace the corresponding picture to display the corresponding oil. The current problem is that when I update the picture, the picture corresponding to the previous oil amount is not refreshed or deleted. What I want to ask is, is there a corresponding way to delete the picture from the last render?  
 ![fc2](https://forum.microej.com/uploads/default/original/1X/a0c745b4944d29b9df913710c5959f1153d0978f.png)  
 ![fc3](https://forum.microej.com/uploads/default/original/1X/11ff2c74ed312fb29def25291355b3505c909790.png)

---

<div class="post-metadata">

**Author:** ![thomas.pons](https://forum.microej.com/user_avatar/forum.microej.com/thomas.pons/32/133_2.png) [@thomas.pons](https://forum.microej.com/u/thomas.pons)\
**Post date:** [May 6, 2022, 1:27pm UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076/4 "2022-05-06T13:27:48Z")

</div>

Hello guankai,

My guess is that your widget has a transparent background in its style attributes.  
A solid background (like `ej.mwt.style.background.RectangularBackground`) allows for “cleaning” the widget area by erasing the pixels of any previous rendering: it basically fills the widget area with a given color.  
On the other hand, a transparent background (i.e., `ej.mwt.style.background.NoBackground`) does nothing, so the drawings of the widget `renderContent()` overlap with the content already on screen.

So, if the rendering of your widget does not erase/cover the content of the previous rendering, it could be because the style applied to your widget uses a `NoBackground` as background. Check if your widget and its parents use `NoBackground` (look for `style.setBackground(NoBackground.NO_BACKGROUND`) in your style definition).

You could also check if the default style of your stylesheet uses the `NoBackground` (see the default style retrieved from `ej.mwt.stylesheet.cascading.CascadingStylesheet.getDefaultStyle()`).

Best regards,

Thomas

---

<div class="post-metadata">

**Author:** ![thomas.pons](https://forum.microej.com/user_avatar/forum.microej.com/thomas.pons/32/133_2.png) [@thomas.pons](https://forum.microej.com/u/thomas.pons)\
**Post date:** [May 12, 2022, 9:32am UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076/5 "2022-05-12T09:32:04Z")

</div>

Hello @guankai,

could you resolve your issue?

Best regards,

Thomas

---

<div class="post-metadata">

**Author:** ![guankai](https://forum.microej.com/letter_avatar_proxy/v4/letter/g/d9b06d/32.png) [@guankai](https://forum.microej.com/u/guankai)\
**Post date:** [May 13, 2022, 8:06am UTC](https://forum.microej.com/t/requestrender-last-image-can-not-deleted/1076/6 "2022-05-13T08:06:44Z")

</div>

Hello @thomas.pons

I have solved it by partially refreshing the underlying image.

thanks
