dzhax Posted January 15, 2012 Share Posted January 15, 2012 I am working on a dynamic image script for someone and I need to have a background image and also load an avatar image also. Is this possible? All the documentation i can find only shows background images that cover the whole image. Also if this make any difference the avatar must be loaded on the fly from the database becasue it can change. It is basically a online "trading card" that displays the users avatar and their stats with a nice background image. Link to comment Share on other sites More sharing options...
rain13 Posted January 15, 2012 Share Posted January 15, 2012 Sorry if my answer isn't best but have you tried to look at imagick: http://php.net/manual/en/book.imagick.php ? When I search something I just read trough all function names and if there are loads of functions like with imagick then I let my browser highlight few keywords I am interested in. Link to comment Share on other sites More sharing options...
dzhax Posted January 15, 2012 Author Share Posted January 15, 2012 Thanks for the suggestion SoltBeings but, unless i read it wrong you can't display multiple at the same time. That is more for like multiple sizes of the same image or displaying an image style button (on/off) look of the button. Correct me if im wrong. Link to comment Share on other sites More sharing options...
birbal Posted January 15, 2012 Share Posted January 15, 2012 http://php.net/gd2 for easy image handling you want to merge two images? background and avatar? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 15, 2012 Share Posted January 15, 2012 IS there no reason you cant load one image for the parent element background, and load avatar image as img child element or the background of another div child element, so that it overlaps the larger using css position relative and position: absolute and set its stack level using z-index, or am i getting what you require totally wrong? Link to comment Share on other sites More sharing options...
dzhax Posted January 15, 2012 Author Share Posted January 15, 2012 currently using GD to make the image. its so i can call an img tag and put a url in the src field to display it. @birbal ill take a look at GD2. Yes that is exactly what im looking to do also adding text here and there also I might need to add more than just the avatar image wise to it also. Link to comment Share on other sites More sharing options...
dzhax Posted January 16, 2012 Author Share Posted January 16, 2012 GD2 is a bust also. nothing about multiple images. Starting to think this isnt possible... Link to comment Share on other sites More sharing options...
birbal Posted January 16, 2012 Share Posted January 16, 2012 There is nothing as impossible in programing. gd have all the funtion to work with even in pixel level. the steps would be like1) first create a empty image resource using http://php.net/imagecreatetruecolor]imagecreatetruecolor() (consider it as blank canvas)2) create anothe resource for background image imagecreatefrom*() .3) use imagecopyresampled() to copy the image into the first image resource.4) same way do with the avatar and other image you msy like to add5) use image*() to display or save the filehttp://au2.php.net/manual/en/function.imagettftext.php for text manupulation in image(* will be the format of the file) also consider the way as dsonuk has said. if it is possible with just html css better option would be that. if it is not your option you can go with gd. if the image is not changing over and over it would be best to manupulate it at the time when user upload the avatar. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 17, 2012 Share Posted January 17, 2012 You can do the same thing with regular GD I believe also. The point is to open each image, plus a blank one for the final, and copy the images into the final from the bottom up. That's how you merge multiple images. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.