ExportGraphics

Utility functions for exporting a Graphics2D drawable to some eps, pdf, and png.

class Object
trait Matchable
class Any

Type members

Types

type Drawable = Graphics2D => Unit

A Drawable is any function that draws to a Graphics2D context.

A Drawable is any function that draws to a Graphics2D context.

Value members

Concrete methods

def writeEPS(out: OutputStream, draw: Drawable, width: Int, height: Int): Unit

Writes the given drawable to the given OutputStream formatted as eps.

Writes the given drawable to the given OutputStream formatted as eps.

def writeFile(file: File, draw: Drawable, width: Int, height: Int, dpi: Int): Unit

Writes the given drawable to a new file of the given name with the given dpi (for rasterized formats only). The extension of the file determines its format, with options png, eps, svg, and pdf.

Writes the given drawable to a new file of the given name with the given dpi (for rasterized formats only). The extension of the file determines its format, with options png, eps, svg, and pdf.

def writePDF(out: OutputStream, draw: Drawable, width: Float, height: Float): Unit

Writes the given drawable to the given OutputStream formatted as pdf. Contributed by Robby McKilliam.

Writes the given drawable to the given OutputStream formatted as pdf. Contributed by Robby McKilliam.

def writePNG(out: OutputStream, draw: Drawable, width: Int, height: Int, dpi: Int): Unit

Writes the given drawable to the given OutputStream at the given dpi, formatted as png.

Writes the given drawable to the given OutputStream at the given dpi, formatted as png.