egd - erlang graphical drawer.

egd - erlang graphical drawer


point() = {integer(), integer()}
render_option() = {render_engine, opaque} | {render_engine, alpha}


create(Width::integer(), Height::integer()) -> egd_image()

Creates an image area and returns its reference.

destroy(Image::egd_image()) -> ok

Destroys the image.

render(Image::egd_image()) -> binary()

render(Image::egd_image(), Type::png | raw_bitmap) -> binary()

render(Image::egd_image(), Type::png | raw_bitmap, Options::[render_option()]) -> binary()

Renders a binary from the primitives specified by egd_image(). The binary can either be a raw bitmap with rgb tripplets or a binary in png format.

line(Image::egd_image(), P1::point(), P2::point, Color::color()) -> ok

Creates a line object from P1 to P2 in the image.

color(Color::{byte(), byte(), byte()}) -> color()

Creates a color reference.

text(Image::egd_image(), P::point(), Font::font(), Text::string(), Color::color()) -> ok

Creates a text object.

rectangle(Image::egd_image(), P1::point(), P2::point(), Color::color()) -> ok

Creates a rectangle object.

filledRectangle(Image::egd_image(), P1::point(), P2::point(), Color::color()) -> ok

Creates a filled rectangle object.

filledEllipse(Image::egd_image(), P1::point(), P2::point(), Color::color()) -> ok

Creates a filled ellipse object.

save(Binary::binary(), Filename::string()) -> ok

Saves the binary to file.

View Functions