
ireallylikepie
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by ireallylikepie
-
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Yeah, haha, realized that shortly after replying to the post. (: Thanks again ! -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Ahh nevermind I've fixed it!(: Was missing the & Thank you so so so much for all your help! I truly appreciate it. -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
I can't seem to get the variables from one php file to the other. :/ Should I be using include or $_GET ? -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
No, I created a textbox in which the user could input their desired background color. On mainpage.php, $back = $_GET['backgroundinput'] and then I print <body style='background-color:$back;'></body> -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Ahhh! Am I doing something wrong --- now no image shows up!! <?php $im = imagecreatefrompng($_GET['i']); include 'mainpage.php'; $bg = $back; $im = imagerotate($im, $_GET['r'], $bg); header('content-type: image/png'); imagecolortransparent($im, $bg); imagealphablending( $im, false ); imagesavealpha( $im, true ); imagepng($im); imagedestroy($im); ?> -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Yes, however, I made it so that the user could choose the background color. Is it possible to use a variable in imagecolorallocate? -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Yes. I think I know what the problem is though. I added these two lines as well, to keep the original image background transparent. imagealphablending( $im, false ); imagesavealpha( $im, true ); When I remove those two lines, the image background isn't transparent, but the pink corners are gone. -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
I must have something else wrong in my code then, because i see this: (Turquoise is the current background of the site) -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Hmm... now it's pink? -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
I've tried : imagesavealpha( $im, true ); and changing the code you've provided with: $im = imagerotate($im, $_GET['d'], 0); but it still doesn't seem to work. D: -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
The rotating worked! However, my images were basically all in black with a transparent background, but for some reason the rotating cause there to be a white background for each image. I'm guessing that this is from the image colorallocate... so is there someway I can make do without it ? No, I would like each image to rotate by a randomly generated degree. So you're saying I could use a <div style = ""></div> ? -
Random Width/Height and Random Rotation
ireallylikepie replied to ireallylikepie's topic in PHP Coding Help
Hmmm, I'm not sure what language this is, and how I would put it into my php loop. Yay! It works now. (: Hmm, but if I want each picture to rotate a different number of degrees, wouldn't I have to put it into the php loop? Could I use: echo file_get_contents('picture.css'); And then in the separate css file would I put in: .image-box img { transform: rotate($degree); -moz-transform: rotate($degree); -webkit-transform: rotate($degree); } I'm not sure if you can put in variables in CSS, or how to put something in php under a class. :/ -
Hi, New coder here! I'm making a php If loop that will post my image a set number of times (depending on user input in a text box), and I have that all figured out. However, I can't figure out how to rotate the image a random amount of degrees and have a random width/height for each image. Will rand generate new numbers for each time the image is echo-ed, or will it give the same number for all images? This is what I have: <?php function pic($picture) { $degree = rand(0,360) $num = rand(50,250) $total = 0; while ($total < $picture){ echo '<img src=blabla.gif width="$num" height="$num">'; $total = $total + 1; } } $picture = $_GET['input']; $a = pic($picture); } ?> Thanks in advance!