i want help, i want the output for text on the image. that is see the code <?php $str="<b>Hello World</b>"; $im = imagecreatetruecolor(500, 500); $text_color = imagecolorallocate($im, 233, 255, 100); imagestring($im, 1, 5, 5, $str, $text_color); header('Content-type: image/jpeg'); imagejpeg($im); imagedestroy($im); ?> Code (markup): i got the output is <b>Hello World</b> but, i need the output is Hello World on the image please any one have idea?
no. this is file1.php file <?php echo' <script type="text/javascript"> <!-- function popup() { alert("Hello World") } //--> </script>'; echo '<body> <input type="button" onclick="popup()" value="popup"> </body>'; ?> PHP: display output on the image <?php $file = file_get_contents('./file1.php', public_html); $im = imagecreatetruecolor(500, 500); $text_color = imagecolorallocate($im, 233, 255, 100); imagestring($im, 1, 5, 5, $file, $text_color); // Set the content type header - in this case image/jpeg header('Content-type: image/jpeg'); // Output the image imagejpeg($im); // Free up memory imagedestroy($im); ?> PHP: it shows errors. i'll use verification in script, when i click the button it verify and display the hello world on image at second php file. so my output is Hello World on the image how can i get? pls give any idea........
If you dont want to get banned.. don't duplicate threads. Here the another one http://forums.digitalpoint.com/showthread.php?t=1398442
This seems to work OK. You can change the value of "$n<=" to change the font weight. 2 for semi-bold; 8 for really bold. // Create a new image instance $im = imagecreatetruecolor(200, 200); // Make the background white imagefilledrectangle($im, 0, 0, 199, 199, 0xFFFFFF); $textcolor = imagecolorallocate($im, 0, 0, 0); imagestring($im, 5, 100, 80, 'Normal Text', $textcolor); $x_cord = 100; $y_cord = 100; $text = 'Bold Text'; $_x = array(1, 0, 1, 0, -1, -1, 1, 0, -1); $_y = array(0, -1, -1, 0, 0, -1, 1, 1, 1); // Change value of "$n<=" to change font-weight for($n=0;$n<=8;$n++) { imagestring($im, 8, $x_cord+$_x[$n], $y_cord+$_y[$n], $text, $textcolor); } // Output the image to browser header('Content-type: image/gif'); imagegif($im); imagedestroy($im); PHP: