# Image() flickers when changing sketch size with windowResize()

**URL:** https://discourse.processing.org/t/image-flickers-when-changing-sketch-size-with-windowresize/38952
**Category:** Coding Questions
**Created:** [September 23, 2022, 9:41pm UTC](https://discourse.processing.org/t/image-flickers-when-changing-sketch-size-with-windowresize/38952 "2022-09-23T21:41:27Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [September 24, 2022, 1:01am UTC](https://discourse.processing.org/t/image-flickers-when-changing-sketch-size-with-windowresize/38952/3 "2022-09-24T01:01:45Z")

</div>

Hello @sableraph,

My exploration of this:

```auto
// windowResize Flicker
// v1.0.0
// GLV 2022-09-23

//References:
// https://forum.processing.org/one/topic/flickering-when-using-the-java-frame-resize-method#25080000001705051.html
// https://github.com/processing/processing4/blob/main/build/shared/revisions.md

PImage img1;
int sz;

void setup()
  {
  windowResizable(true);
  img1 = loadImage("frog.png");
  sz = 200;
  windowResize(sz, sz);
  delay(12);
  frameRate(60);
  }
  
void draw()
  {
  println(sz, width);
  image(img1, 20, 20, sz-2*20, sz-2*20);
  sz = 200 + frameCount%200;
  windowResize(sz, sz);
  delay(12);
  }

```

I gleaned some insight from here:

[https://forum.processing.org/one/topic/flickering-when-using-the-java-frame-resize-method#25080000001705051.html](https://forum.processing.org/one/topic/flickering-when-using-the-java-frame-resize-method#25080000001705051.html)

The delay got rid of the flicker.

`:)`

---

_[View the full topic](https://discourse.processing.org/t/image-flickers-when-changing-sketch-size-with-windowresize/38952)._
