Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- $size = 32;
- $half_size = $size / 2;
- $font_file = 'Arial Black Regular.ttf';
- $text = 'WWW';
- list(,,$width) = imagettfbbox($size, 0, $font_file, $text);
- $im = imagecreate($width += $size, $height = $size * 2);
- imagecolorallocate($im, 0, 255, 255);
- $font_color = imagecolorallocate($im, 255, 255, 0);
- imagettftext($im, $size, 0, + $half_size, $size + $half_size, $font_color, $font_file, $text);
- $width1 = 200;
- $height1 = 80;
- $offset_x = ($width1 - $width) / 2;
- $offset_y = ($height1 - $height) / 2;
- $rand1 = rand(20, 50) / 1000;
- $rand2 = rand(0, 50);
- // так эта ебланская библиотека нихуя не рисует
- $im1 = imagecreate($width1, $height1);
- imagecolorallocate($im1, 255, 255, 255);
- // $im1 = imagecreatetruecolor($width1, $height1);
- for ($y = 0; $y < $height; ++$y) {
- for ($x = 0; $x < $width; ++$x) {
- $colors = imagecolorsforindex( $im, imagecolorat($im, $x, $y) );
- $color = imagecolorallocate( $im1, $colors['red'], $colors['green'], $colors['blue']);
- $z = $y + floor( $half_size * sin($rand1 * $x + $rand2) );
- imagesetpixel($im1, $offset_x + $x, $offset_y + $z, $color);
- }
- }
- header('Content-type: image/png');
- imagepng($im1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment