# JUCE8 : Strange behaviour with drawImageAt on Windows

**URL:** <https://forum.juce.com/t/juce8-strange-behaviour-with-drawimageat-on-windows/61923>\
**Category:** General JUCE discussion\
**Created:** [June 20, 2024, 7:45am UTC](https://forum.juce.com/t/juce8-strange-behaviour-with-drawimageat-on-windows/61923 "2024-06-20T07:45:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 20, 2024, 2:29pm UTC](https://forum.juce.com/t/juce8-strange-behaviour-with-drawimageat-on-windows/61923/4 "2024-06-20T14:29:47Z")

</div>

The D2D renderer, like the OpenGL renderer, does not draw/copy directly into images. Instead, drawing commands are buffered so that they can be executed more efficiently. When modifying an Image, updates to the image will not be flushed until the BitmapData or Graphics object that is modifying the image goes out of scope.

A similar issue was previously discussed here:

> [@JUCE 8 Direct2D + Melatonin Blur issue](https://forum.juce.com/t/juce-8-direct2d-melatonin-blur-issue/61758/4):
>
> The behavior of the Graphics object for the D2D and OpenGL renderers is that the image is not completely written/flushed intil the Graphics object goes out of scope. The example you provided should work if you add a scope around the Graphics object. If that’s still broken, please let us know. juce::Image result (juce::Image::ARGB, 9, 9, true); { juce::Graphics g (result); g.fillAll (juce::Colours::white); } jassert (result.getPixelAt (2, 2).toDisplayString (true) == "FFFFFFFF"); This h…

---

_[View the full topic](https://forum.juce.com/t/juce8-strange-behaviour-with-drawimageat-on-windows/61923)._
