Is there any way to include a .html file into an image using GD? It doesn't work with the normal means, but instead gives me an error with the html in the source.
Code: Select all
<? header("Content-type: image/png"); $string = require("google.html"); $im = imagecreatefrompng("ad.png"); $orange = imagecolorallocate($im, 220, 210, 60); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, 9, $string, $orange); imagepng($im); imagedestroy($im); ?>
Including a page with GD
Moderator: General Moderators
Including a page with GD
My friend wanted to know, and I have no idea if you can.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Depending on the image format, yes it is possible, but not likely in the way your friends wants. Your friend likely wants to send both the HTML and image so the HTML shows up and the image shows in the HTML. Instead, the binary image data would be merged into the same stream of data as the HTML in this case.