CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
Resizing a generated barcode png

 



cdsi_perl
newbie

Nov 14, 2001, 8:19 AM

Post #1 of 1 (960 views)
Resizing a generated barcode png Can't Post

I am trying to resize a barcode image generated from GD::Barcode. Does any one have any idea on how to do this. Below is some sample code in my attempt to get this to work:

use GD::Barcode;
use GD;
#binmode(STDOUT);
$temppath = "/tmp";
$Code = "Code39";

$mediaid = "A0050";

my $oGDB = GD::Barcode->new("$Code", "$mediaid");
my $oGD = $oGDB->plot(NoText=>1, Height => 40);
$myImage = new GD::Image(200,40);
$png_data = $oGD->png;
open (BC, ">/tmp/bcode.png");
print BC $png_data;
close (BC);
$myImage2 = GD::Image->newFromPng('/tmp/bcode.png');
$npng = $myImage->copyResized($myImage2,0,0,0,0,200,40,80,40);
open open (BC, ">/tmp/bcode2.png");
print BC $npng;
close (BC);

#open(DISPLAY, "| display -");
#binmode DISPLAY;
#print DISPLAY $npng;
#close(DISPLAY);

Thanks.



 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives