-
- 所有已知实现类:
-
AbstractButton,AbstractColorChooserPanel,Applet,BasicArrowButton,BasicComboBoxRenderer,BasicComboBoxRenderer.UIResource,BasicComboPopup,BasicInternalFrameTitlePane,BasicInternalFrameTitlePane.SystemMenuBar,BasicSplitPaneDivider,BasicToolBarUI.DragWindow,Box,Box.Filler,Button,Canvas,CellRendererPane,Checkbox,Choice,Component,Container,DefaultListCellRenderer,DefaultListCellRenderer.UIResource,DefaultTableCellRenderer,DefaultTableCellRenderer.UIResource,DefaultTreeCellEditor.DefaultTextField,DefaultTreeCellEditor.EditorContainer,DefaultTreeCellRenderer,Dialog,FileDialog,Frame,JApplet,JButton,JCheckBox,JCheckBoxMenuItem,JColorChooser,JComboBox,JComponent,JDesktopPane,JDialog,JEditorPane,JFileChooser,JFormattedTextField,JFrame,JInternalFrame,JInternalFrame.JDesktopIcon,JLabel,JLayer,JLayeredPane,JList,JMenu,JMenuBar,JMenuItem,JOptionPane,JPanel,JPasswordField,JPopupMenu,JPopupMenu.Separator,JProgressBar,JRadioButton,JRadioButtonMenuItem,JRootPane,JScrollBar,JScrollPaneJScrollPane,JScrollPane.ScrollBar,JSeparator,JSlider,JSpinner,JSpinner.DateEditor,JSpinner.DefaultEditor,JSpinner.ListEditor,JSpinner.NumberEditor,JSplitPane,JTabbedPane,JTable,JTableHeader,JTextArea,JTextComponent,JTextField,JTextPane,JToggleButton,JToolBar,JToolBar.Separator,JToolTip,JTree,JViewport,JWindow,Label,List,MetalComboBoxButton,MetalComboBoxUI.MetalComboPopup,MetalFileChooserUI.FileRenderer,MetalFileChooserUI.FilterComboBoxRenderer,MetalInternalFrameTitlePane,MetalScrollButton,Panel,Scrollbar,ScrollPane,TextArea,TextComponent,TextField,Window
public interface ImageObserver一个异步更新接口,用于在构建Image时接收有关Image信息的通知。
-
-
字段汇总
字段 变量和类型 字段 描述 static intABORTimageUpdate的infoflags参数中的此标志表示在生产完成之前中止异步跟踪的图像。static intALLBITSimageUpdate的infoflags参数中的此标志表示先前绘制的静态图像现在已完成,并且可以以其最终形式再次绘制。static intERRORimageUpdate的infoflags参数中的此标志表示异步跟踪的图像遇到错误。static intFRAMEBITSimageUpdate的infoflags参数中的此标志表示现在可以再次绘制先前绘制的多帧图像的另一个完整帧。static intHEIGHTimageUpdate的infoflags参数中的此标志表示基本图像的高度现在可用,并且可以从height参数获取到imageUpdate回调方法。static intPROPERTIESimageUpdate的infoflags参数中的此标志表示图像的属性现在可用。static intSOMEBITSimageUpdate的infoflags参数中的此标志表示绘制图像的缩放变体所需的更多像素可用。static intWIDTHimageUpdate的infoflags参数中的此标志表示基本图像的宽度现在可用,并且可以从width参数获取到imageUpdate回调方法。
-
方法摘要
所有方法 实例方法 抽象方法 变量和类型 方法 描述 booleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height)当有关使用异步接口先前请求的图像的信息变得可用时,调用此方法。
-
-
-
字段详细信息
-
WIDTH
static final int WIDTH
imageUpdate的infoflags参数中的此标志表示基本图像的宽度现在可用,并且可以从width参数获取到imageUpdate回调方法。
-
HEIGHT
static final int HEIGHT
imageUpdate的infoflags参数中的此标志表示基本图像的高度现在可用,并且可以从height参数获取到imageUpdate回调方法。
-
PROPERTIES
static final int PROPERTIES
imageUpdate的infoflags参数中的此标志表示图像的属性现在可用。
-
SOMEBITS
static final int SOMEBITS
imageUpdate的infoflags参数中的此标志表示绘制图像的缩放变体所需的更多像素可用。 可以从imageUpdate回调方法的x,y,width和height参数中获取新像素的边界框。
-
FRAMEBITS
static final int FRAMEBITS
imageUpdate的infoflags参数中的此标志表示现在可以再次绘制先前绘制的多帧图像的另一个完整帧。 应忽略imageUpdate回调方法的x,y,width和height参数。
-
ALLBITS
static final int ALLBITS
imageUpdate的infoflags参数中的此标志表示先前绘制的静态图像现在已完成,并且可以以其最终形式再次绘制。 应忽略imageUpdate回调方法的x,y,width和height参数。
-
ERROR
static final int ERROR
imageUpdate的infoflags参数中的此标志表示异步跟踪的图像遇到错误。 没有更多信息可用,绘制图像将失败。 为方便起见,将同时指示ABORT标志以指示图像生成已中止。
-
ABORT
static final int ABORT
imageUpdate的infoflags参数中的此标志表示在生产完成之前中止异步跟踪的图像。 如果没有进一步的操作来触发另一个图像生成序列,将无法获得更多信息 如果在此映像更新中未设置ERROR标志,则访问映像中的任何数据将重新启动生产,可能从头开始。
-
-
方法详细信息
-
imageUpdate
boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
当有关使用异步接口先前请求的图像的信息变得可用时,调用此方法。 异步接口是方法调用,例如getWidth(ImageObserver)和drawImage(img,x,y,ImageObserver),它们将ImageObserver对象作为参数。 这些方法将调用者注册为关于整体图像本身的信息(在getWidth(ImageObserver)的情况下)或关于图像的输出版本(在drawImage的情况下(img,x,y,[w, h,] ImageObserver)调用)。如果需要进一步更新,此方法应返回true;如果已获取所需信息,则返回false。 正在跟踪的图像使用img参数传递。 组合各种常量以形成infoflags参数,该参数指示现在可获得关于图像的哪些信息。 x,y,width和height参数的解释取决于infoflags参数的内容。
该
infoflags参数应该是按位下列标志的OR:WIDTH,HEIGHT,PROPERTIES,SOMEBITS,FRAMEBITS,ALLBITS,ERROR,ABORT。- 参数
-
img- 正在观察的图像。 -
infoflags-按位下列标志的OR:WIDTH,HEIGHT,PROPERTIES,SOMEBITS,FRAMEBITS,ALLBITS,ERROR,ABORT。 -
x- x坐标。 -
y- y坐标。 -
width- 宽度。 -
height- 高度。 - 结果
-
false如果infoflags表明图像已完全加载; 否则为true。 - 另请参见:
-
WIDTH,HEIGHT,PROPERTIES,SOMEBITS,FRAMEBITS,ALLBITS,ERROR,ABORT,Image.getWidth(java.awt.image.ImageObserver),Image.getHeight(java.awt.image.ImageObserver),Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
-
-