# drawImage bug?

**URL:** <https://forum.juce.com/t/drawimage-bug/57915>\
**Category:** General JUCE discussion\
**Created:** [September 17, 2023, 6:49pm UTC](https://forum.juce.com/t/drawimage-bug/57915 "2023-09-17T18:49:36Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [September 17, 2023, 10:16pm UTC](https://forum.juce.com/t/drawimage-bug/57915/6 "2023-09-17T22:16:37Z")

</div>

> [@aaronleese1](#):
>
> ```c++
> void myComponent::paint(Graphics& g)
> {
> myGraphic->fillEllipse(x - dim/2, getHeight() - 30 - dim/2, dim, dim);
> 
> ```

What kind of graphics context and/or image are you using? IIRC, the OpenGL graphics context may not flush image modifications until the Graphics instance itself is destroyed (more details [here](https://forum.juce.com/t/part-of-output-not-visible-when-2d-drawing-with-opengl-context/56547/5)). In that case, reusing a Graphics instance across multiple paint calls won’t produce the expected results, because the instance is not destroyed after rendering to the image.

Other renderers might do something similar. To see whether this is the problem, you could try creating a Graphics instance that is local to the function, and that is destroyed before calling `g.drawImageAt`.

---

_[View the full topic](https://forum.juce.com/t/drawimage-bug/57915)._
