Class PrinterGraphics


public class PrinterGraphics extends ScaledGraphics
A scalable graphics object used to print to a printer.
  • Constructor Details

    • PrinterGraphics

      public PrinterGraphics(Graphics g, Printer p)
      Creates a new PrinterGraphics with Graphics g, using Printer p
      Parameters:
      g - Graphics object to draw with
      p - Printer to print to
  • Method Details

    • dispose

      public void dispose()
      Description copied from class: Graphics
      Disposes this object, releasing any resources.
      Overrides:
      dispose in class ScaledGraphics
      See Also:
    • drawImage

      public void drawImage(Image srcImage, int x, int y)
      Description copied from class: Graphics
      Draws the given Image at the location (x,y).
      Overrides:
      drawImage in class ScaledGraphics
      Parameters:
      srcImage - the Image
      x - the x coordinate
      y - the y coordinate
      See Also:
    • drawImage

      public void drawImage(Image srcImage, int sx, int sy, int sw, int sh, int tx, int ty, int tw, int th)
      Description copied from class: Graphics
      Draws a rectangular section of the given Image to the specified rectangular reagion on the canvas. The section of the image bounded by the rectangle (x1,y1,w1,h1) is copied to the section of the canvas bounded by the rectangle (x2,y2,w2,h2). If these two sizes are different, scaling will occur.
      Overrides:
      drawImage in class ScaledGraphics
      Parameters:
      srcImage - the image
      sx - the x coordinate of the source
      sy - the y coordinate of the source
      sw - the width of the source
      sh - the height of the source
      tx - the x coordinate of the destination
      ty - the y coordinate of the destination
      tw - the width of the destination
      th - the height of the destination
      See Also:
    • setLineAttributes

      public void setLineAttributes(LineAttributes attributes)
      Overridden to translate dashes to printer specific values.
      Overrides:
      setLineAttributes in class ScaledGraphics
      Parameters:
      attributes - the line attributes
      See Also: