XBM is a simple image format. We can show a dynamic picture easily via it, and some CGI use XBM files, but it can't be used in browsers such as the one from WindowsXP(sp2), therefore we need the Image::Xbm2bmp module to convert it.
SYNOPSIS
use Image::Xbm2bmp;
#Create a object from a xbm file
my $obj = Image::Xbm2bmp->new("/tmp/test.xbm");
#Create a object from array data
my $xbm_width = 32;
my $xbm_height = 24;
my @xbm_data = (
0x7c,0x3c,0x7c,0x3c,
0xfe,0x7c,0xfe,0x7c,
0xee,0xee,0xee,0xee,
0xe0,0xee,0x60,0xee,
0x70,0xfe,0x30,0xfe,
0x38,0xec,0xe0,0xec,
0x1c,0xe0,0xee,0xe0,
0xfe,0x7e,0xfe,0x7e,
0xfe,0x3c,0x7c,0x3c
);
my $obj = Image::Xbm2bmp->new();
$obj->load_xbm_data(\@xbm_data,$xbm_width,$xbm_height);
#Save as a BMP file
$obj->to_bmp_file("/tmp/test.bmp");
#Or get a packed data
my $packed_data = $obj->to_bmp_pack();
open(FILE,">/tmp/test.bmp");
print FILE $packed_data;
close(FILE);
#In CGI script
print "Content-type: image/bmp\n\n";
print $obj->to_bmp_pack();
Product's homepage
Requirements:
· Perl