note 6754 modified in ImageColorTransparent by ronabop

From: Date: Wed, 04 Oct 2000 14:54:27 +0000
Subject: note 6754 modified in ImageColorTransparent by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-6035@lists.php.net to get a copy of this message
For example: <? $font = "./Arial.ttf"; $font_size = 18; $font_angle = 0; $width = 300; $height = 400; $text = "test"; $im = ImageCreateFromJpeg("./test.jpg"); $im_str = ImageCreate($width,$height); $black = ImageColorAllocate($im_str, 0, 0, 0); $white = ImageColorAllocate($im_str, 255, 255, 255); ImageColorTransparent($im_str, $black); ImageTTFText($im_str, $font_size, $font_angle, 0, 15, $white, $font, $text); ImageCopyResized($im,$im_str,0,0,0,0,$width,$height,$width,$height); ImageInterlace($im, 1); header("Content-type: image/jpeg"); ImageJpeg($im); ImageDestroy($im_str); ImageDestroy($im); ?> if you disable the function ImageColorTransparent(), you will be able to see a black rectangle on the upper left conner. http://www.php.net/manual/function.imagecolortransparent.php

« previous php.notes (#6035) next »