14. november 2006 - 15:25
Der er
2 kommentarer og 2 løsninger
Justere lysstyrken i et billede
Hej! Kan man justere lysstyrken på billedet i denne kode - eller i det hele taget generelt? <?php // Set the content-type header("Content-type: image/jpeg"); $sourcepic = $_GET[image]; // Create the image $im = imagecreatefromjpeg($sourcepic); // Create some colors $txtcolor = imagecolorallocate($im, 255, 255, 255); // The text to draw $text = $_GET[text]; // Replace path by your own font path $font = 'tahomabold.ttf'; // Add the text imagettftext($im, 20, 0, 10, 120, $txtcolor, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im, '', 100); imagedestroy($im); ?>
Annonceindlæg fra SuperOffice
14. november 2006 - 18:19
#1
Hvis du kører PHP 5 kan du lave: <?php // Set the content-type header("Content-type: image/jpeg"); $sourcepic = $_GET[image]; // Create the image $im = imagecreatefromjpeg($sourcepic); // Adjust brigtness imagefilter( $im, IMG_FILTER_BRIGHTNESS, 25 ); // Create some colors $txtcolor = imagecolorallocate($im, 255, 255, 255); // The text to draw $text = $_GET[text]; // Replace path by your own font path $font = 'tahomabold.ttf'; // Add the text imagettftext($im, 20, 0, 10, 120, $txtcolor, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im, '', 100); imagedestroy($im); ?>
16. november 2006 - 14:26
#2
Tak! Hvaliteten var ikke god nok, så jeg fandt en JS-løsning på dynamicdrive.com Men smid et svar - dit virkede efter hensigten! MS