I have created a CMS where users can rate ten different categories on a scale from 1-10. When they are done I want to use the data to create an image showing the scores mapped out in a star. The “star” is generic, so it is just a .jpg image. So the trick is to plot in the ten different scores onto the image of the star. The combo of the image of the star and the scores should then be saved as a jpg on the server in order to show it to the user.
So before the image will just look like this:
http://junique.dk/star-before.jpg
And after the image will look like this:
http://junique.dk/star-after.gif
Appreciate all the help I can get!
You can use GD to achieve this.
imagecreatefromjpeg. (It’d be preferable if you had the image as a png instead, as it’s more suitable for simple drawings. If you do that, you need to useimagecreatefrompnginstead, naturally)imageline. You’ll need to calculate these positions yourself, for instance by finding them in your image editor.imagepng(preferred) orimagejpeg. Remember to set the proper content type, as shown in the examples on the page.