Thats huge, if you are interested in generating PNG images and don't wanna have dependencies on c-libraries (as you would have using my cairo wrapper erlycairo). Egd won't win any speed competition and has a limited feature set, but runs out of the box on any Erlang supported platform !--- percept-0.7 ------------------------------------------------------------
OTP-7162 Percept no longer depends on external c-libraries. The
graphical rendering is now done via erlang code.
Showing posts with label cairo. Show all posts
Showing posts with label cairo. Show all posts
Wednesday, April 09, 2008
Erlang R12B-2 released - with native PNG drawing
It's a bugfix release and I had no big expectations when scanning through the release notes, but then I spotted this:
Friday, November 30, 2007
Updated ErlyCairo
Did some housekeeping on my growing inventory of Erlang open source projects targeted to web development. I completely rewrote the Erlang part of ErlyCairo, the Erlang bindings for the Cairo 2D graphics library. Previously it had a hard coded node name for the C-node, now it is based on a much more flexible gen-server approach.
Below see how to use this software to create a simple, purple, 100px * 100px PNG image:
Below see how to use this software to create a simple, purple, 100px * 100px PNG image:
start() ->
erlycairo:start_link().
%% if you run multiple C-Nodes, to avoid nodename conflicts
start(CNodeNumber) ->
erlycairo:start_link(CNodeNumber).
stop() ->
erlycairo:stop().
create_images()->
rect("rect.png", 100, 100, {1.0, 0.2, 0.7, 1.0}).
rect(File, Width, Height, {Red, Green, Blue, Alpha}) ->
case erlycairo:new_image_blank(Width, Height) of
ok ->
erlycairo:set_source_rgba(Red, Green, Blue, Alpha),
erlycairo:rectangle(0, 0, Width, Height),
erlycairo:fill(),
erlycairo:write_to_png(File),
erlycairo:close_image(),
ok;
{error, Reason} ->
exit(Reason)
end.
Sunday, July 22, 2007
Erlycairo - an Erlang 2D graphics library
I just uploaded Erlang bindings for the cairo 2D graphics library to googlecode:
http://code.google.com/p/erlycairo/
I use it in my projects for generating CSS background images for flexible-size buttons, rounded corners and similar.
http://code.google.com/p/erlycairo/
I use it in my projects for generating CSS background images for flexible-size buttons, rounded corners and similar.
Subscribe to:
Posts (Atom)