Hiding a percentage of an image with php gd only revealing a percentage of the image
I've looked around but cant seem to find what I need.
I am looking for something that will allow the use of php gd to create an image from an image file but based on a percentage value that is passed to it which will be calculated from elsewhere, I need the image to be covered/overlayed with say a black rectangle the same size as the image but this percentage value would determine how much of the image shows.
So if percent passed to it was 0 then the entire image is hidden by the black rectangle, if 25% only the bottom 25 percent would be visible and the top 75% would be hidden by the rectangle and so on.
Anyone know of anything out there already that does this or the code to create a rectangle over an image but only covering the top xx percentage of the image based on a value passed to it.
Thanks in advance.
Or maybe even better to do this
Take a png file as a background and take another (with transparency) as a foreground image, and display a percentage of the foreground image from the bottom up.
I found some code using imagecopymerge but changing the value of the src height shows a portion of the image from the top down and I cannot figure out a way to make it show from the bottom up (short of making both images upside down doing this to merge them and then doing something else to flip them the right way up again)
Last edited by BWWebDesigns; 06-24-2013 at 01:30 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread