shadow_text.cgi

来自「嵌入式WEB」· CGI 代码 · 共 41 行

CGI
41
字号
#!/usr/bin/perl -wuse strict;use CGI;use Image::Magick;use constant FONTS_DIR => "/usr/local/httpd/fonts";my $q      = new CGI;my $font   = $q->param( "font" )  || 'cetus';my $size   = $q->param( "size" )  || 40;my $string = $q->param( "text" )  || 'Hello!';my $color  = $q->param( "color" ) || 'black';$font   =~ s/\W//g;$font   = 'bodiac' unless -e FONTS_DIR . "/$font.ttf";my $image = new Image::Magick( size => '500x100' );$image->Read( 'xc:white' );$image->Annotate( font      => "\@@{[ FONTS_DIR ]}/$font.ttf",                   pen       => 'gray',                  pointsize => $size,                  gravity   => 'Center',                  text      => $string );$image->Blur( 100 );$image->Roll( "+5+5" );$image->Annotate( font      => "\@@{[ FONTS_DIR ]}/$font.ttf",                   pen       => $color,                  pointsize => $size,                  gravity   => 'Center',                  text      => $string );binmode STDOUT;print $q->header( "image/jpeg" );$image->Write( "jpeg:-" );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?