MainComputersProgrammingLanguages › Image::Imlib2

Image::Imlib2

Edit Page
Report
Scan day: 03 March 2014 UTC
-73
Virus safety - good
Description: CPAN module which supports reading, creating and saving JPEG, PNG and GIF files. Provides documentation and sample code.
Image::Imlib2 - search.cpan.org Module Version: 1.13     Latest Release:  Image::Imlib2 - Interface to the Imlib2 image library use Image::Imlib2; # create a new image my $image = Image::Imlib2->new(200, 200); # or load an image $image = Image::Imlib2->load("foo.png"); # Enable the alpha channel support $image->has_alpha(1); # set a colour (rgba, so this is transparent orange) $image->set_color(255, 127, 0, 127); # draw a rectangle $image->draw_rectangle(50, 50, 50, 50); # draw a filled rectangle $image->fill_rectangle(150, 50, 50, 50); # draw a line $image->draw_line(0, 0, 200, 50); # set quality before saving $image->set_quality(50); # save out $image->save('out.png'); # create a polygon my $poly = Image::Imlib2::Polygon->new(); # add some points $poly->add_point(0, 0); $poly->add_point(100, 0); $poly->add_point(100, 100); $poly->add_point(0, 100); # fill the polygon $poly->fill(); # draw it closed on image $image->draw_polygon($poly, 1); # create a color range my $cr = Image::Imlib2::ColorRange->new(); # add a color my ($distance, $red, $green, $blue, $alpha) = (15, 200, 100, 50, 20); $cr->add_color($distance, $red, $green, $blue, $alpha); # draw it my($x, $y, $width, $height, $angle) = (20, 30, 200, 200, 1); $image->fill_color_range_rectangle($cr, $x, $y, $width, $height, $angle);
Size: 1494 chars

Contact Information

Email:
Phone&Fax:
Address:
Extended:

WEBSITE Info

Page title:Image::Imlib2 - search.cpan.org
Keywords:
Description:
IP-address:199.15.176.161