Java – what is imageobserver?
When you draw an image, you need an image observer New comments new new new flag new new new flag new new flag new flag new flag new flag new flag new flag new flag new flag new flag new flag new 200 new flag new flag new flag new flag new 200 new flag new 200 new flag new new flag new 200 new flag new 200 new flag new 200 new flag new 200 new flag but my question is, what defines an image observer and what does it do? I'm confused
Solution
First, imageobserver is an interface According to docs:
In other words, it is an object - oriented way to use images that can be modified before they are fully created The imageupdate method (image img, int infoflags, int x, int y, int width, int height) is called when the image is modified Returns true if you want to further change the notification, otherwise false This method can be used to force size, resolution, color, etc It also has some control over errors (error flag) For more information, see this
The observer can also process important information about the image – for example, if we draw the image on the screen and change it to larger information before rendering is complete, there must be a way to inform us that any content dimension we draw has changed (allocate more space) and the change must be processed In this case, the fact that imageobserver is asynchronous is very important