AshleyByrom Posted October 25, 2009 Share Posted October 25, 2009 Okay well I am trying to make a 'dynamic' calender image with PHP. I have images like this: and: Obv I have an image for each day of the month (1 - 31) and I have images for each month. if i created a file named, cal.php i want to be able to use that in an img tag and it will mix two images together (month with day below it) and will show today's date. Any guidance, links to tutorials etc? Thanks in advance!! Quote Link to comment Share on other sites More sharing options...
Alex Posted October 25, 2009 Share Posted October 25, 2009 Here's a quick example I put together for you, this will create an image with the two things you provided: <?php // Set the Content-type to image/png to output a PNG image header('Content-type: image/png'); // Create a new image resource(49x49) $im = imagecreatetruecolor(49, 49); //Merge the Month image onto $im, which will be our final image. imagecopy($im, imagecreatefrompng('http://i36.tinypic.com/2vb1tso.png'), 0, 0, 0, 0, 49, 15); //Merge the Day image onto $im imagecopy($im, imagecreatefrompng('http://i37.tinypic.com/2rf6iy8.png'), 0, 15, 0, 0, 49, 34); // Output $im, the image resource imagepng($im); ?> Things you'll want to read up about: PHP GD Library imagecopy() imagecreatetruecolor() imagepng() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.