Class ImageViewPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ImageViewPanel extends JPanel
An image view panel displays a single image and allows zooming and panning with the mouse.
Since:
3.1.3
Author:
Peter Hollemans
See Also:
  • Field Details

  • Constructor Details

    • ImageViewPanel

      public ImageViewPanel()
      Creates a new empty image view panel.
  • Method Details

    • setForeground

      public void setForeground(Color color)
      Overrides:
      setForeground in class JComponent
    • setBackground

      public void setBackground(Color color)
      Overrides:
      setBackground in class JComponent
    • reset

      public void reset()
      Resets the image view to standard magnification.
    • magnify

      public void magnify(double factor)
      Magnifies the view by the specified scale factor.
    • setImage

      public void setImage(Image viewImage)
      Sets the view image. If the image data is not available, it is fetched from the image producer and rendered to the view asynchronously. If the image data is available, it is rendered immediately.
      Parameters:
      viewImage - the new view image, or null for no image.
    • setViewMode

      public void setViewMode(int mode)
      Sets the image view manipulation mode. By default, the no operation mode is in effect.
      Parameters:
      mode - the image mode.