---
name: "ImgChanged"
section: "2"
platform: "linux"
package: "perl-tk"
version: "b11.02-5"
release: "Debian 1.3 (Bo)"
platforms: ["linux"]
url: "https://new.carta.tech/ImgChanged"
---

# ImgChanged(2)

notify widgets that image needs to be redrawn

## NAME

Tk\_ImageChanged - notify widgets that image needs to be redrawn

## SYNOPSIS

```
#include <tk.h>

Tk_ImageChanged(imageMaster, x, y, width, height, imageWidth, imageHeight)
```

## ARGUMENTS

Token for image, which was passed to image's *createProc* when the image was created. X-coordinate of upper-left corner of region that needs redisplay (measured from upper-left corner of image). Y-coordinate of upper-left corner of region that needs redisplay (measured from upper-left corner of image). Width of region that needs to be redrawn, in pixels. Height of region that needs to be redrawn, in pixels. Current width of image, in pixels. Current height of image, in pixels.

## DESCRIPTION

An image manager calls **Tk\_ImageChanged** for an image whenever anything happens that requires the image to be redrawn. As a result of calling **Tk\_ImageChanged**, any widgets using the image are notified so that they can redisplay themselves appropriately. The *imageMaster* argument identifies the image, and *x*, *y*, *width*, and *height* specify a rectangular region within the image that needs to be redrawn. *imageWidth* and *imageHeight* specify the image's (new) size.

An image manager should call **Tk\_ImageChanged** during its *createProc* to specify the image's initial size and to force redisplay if there are existing instances for the image. If any of the pixel values in the image should change later on, **Tk\_ImageChanged** should be called again with *x*, *y*, *width*, and *height* values that cover all the pixels that changed. If the size of the image should change, then **Tk\_ImageChanged** must be called to indicate the new size, even if no pixels need to be redisplayed.

## SEE ALSO

Tk\_CreateImageType

## KEYWORDS

images, redisplay, image size changes
