package visHuman.onePointZero; import java.awt.*; import java.net.URL; import java.awt.image.*; public class TitleLogo extends Canvas implements ImageObserver { Image picture; public TitleLogo(URL dataBase, VisibleHuman root) { setBackground(Color.white); picture = root.getImage(dataBase, "VHVlogo.gif"); picture.getWidth(this); } /** Call update when respont to a exposure */ public void paint(Graphics g) { int xoff = (size().width - picture.getWidth(this))/2; int yoff = (size().height - picture.getHeight(this))/2; g.drawImage(picture, xoff, yoff, this); } public boolean imageUpdate(Image img, int infoFlags, int x, int y, int width, int height) { boolean ret = true; if ( img != this.picture ) return false; if ((infoFlags & (FRAMEBITS | ALLBITS)) != 0) { ret = false; repaint(); } if ((infoFlags & ERROR) != 0) { ret = false; } return ret; } }