View previous topic :: View next topic |
Author |
Message |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Thu Jun 19, 2003 12:16 pm Post subject: how's to use dropshadow ??? |
|
|
Sorry for the stupid question
but i already upload the
1/class.dropshadow.php
2/test.dropshadow.php
3/test.originaldropshadow.php
4/class.originaldropshadow.php
to my server (unix php 4.3.2 gd 2.0.12)
i dont know how to use the dropshadown
and i call www.speak-up.net/shadows/class.dropshadow.php?shadow=1&show=resizeToPercent&input=PLANE.JPG&colour=ffffff&size=50
it displayed a blank screen
pls help me very thanks
Last edited by speak-up on Thu Jun 19, 2003 12:20 pm; edited 1 time in total |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Thu Jun 19, 2003 12:17 pm Post subject: |
|
|
i already upload image file
PLANE.jpg to the same folder (http://www.speak-up.net/shadows/) |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Thu Jun 19, 2003 12:20 pm Post subject: |
|
|
and where i can find the gd for windows??? i'm using win xp ... and i just can find out the gd for unix  |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Mon Jun 23, 2003 6:47 am Post subject: Re: how's to use dropshadow ??? |
|
|
speak-up wrote: | www.speak-up.net/shadows/class.dropshadow.php?shadow=1&show=resizeToPercent&input=PLANE.JPG&colour=ffffff&size=50 |
Hi Speak-Up, and welcome ot the board!
The reason you're getting a blank page shown is because you're trying to access the class directly - you cannot do that. A class first needs to be initiated (using the 'new' constructor) and assigned to a variable, through which you can then use the methods of the class.
Check out the test.dropshadow.php class and you'll see this text:
PHP: | <?php
require "class.dropshadow.php";
$ds = new dropShadow(FALSE);
$ds->setShadowPath('./shadows/');
$ds->loadImage('./images/test.jpg');
$ds->resizeByPercent(50, 0);
$ds->applyShadow('CCCCCC');
$ds->showShadow('png');
?> |
First you include the class file (the 'require' line.) Then you have to create an instance of that class (the 'new dropShadow' line), and then you can use whatever methods you want in that class. Obviously you will want to change the options, or call different functions, or whatever. But that should give you a starting point.
As for GD for windows - it should come in the PHP zip package (don't think it comes with the installer.) You'll want to use gd2.dll, I think is the file name. Don't forget to update your php.ini file for it!
Andy |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Thu Jun 26, 2003 7:52 am Post subject: |
|
|
Hi Andy
I did it, now i know the way to use
Everything is so easy
Very thanks for your help
Hoang
PS : rated 10/10 for the Drop Shadowed Thumbnail Creator  |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Thu Jun 26, 2003 8:12 am Post subject: |
|
|
speak-up wrote: | PS : rated 10/10 for the Drop Shadowed Thumbnail Creator  |
Thanks very much! I'm glad that you've got it working and you like it.
If you're a user of the websites HotScripts.com or PHPClasses.org (links to the left of the browser), then perhaps you could go there and rate the scripts of mine you use? It'd be appreciated!
Cheers, and happy image manipulating!
Andy |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Sat Jun 28, 2003 9:36 am Post subject: |
|
|
Well, if you are always wanting it the same size, the same location, etc., then you could just extend the drop shadow class with your own, and then call that. You would set up one little class that sets all the defaults and then use the file name you pass to call that class with. For example (and I'm winging this, so there may be some mistakes and you may have to tweak it to suit your own needs):
PHP: | <?php
require 'class.dropshadow.php';
class myThumbs extends dropShadow
{
function myThumbs($file)
{
// set up the image
$this->setShadowPath('./shadows/');
$this->loadImage($file);
// obviously you do what you need to here
$this->resizeByPercent(50, 0);
$this->applyShadow('CCCCCC');
// I'm saving, but you could show, or whatever else
$this->saveShadow('png');
}
}
$thumb = new myThumbs($_GET['file']);
?> |
As I'm applying the shadow there I use the saveShadow function. If I were just wanting to resize and save, then I'd use the saveFinal function.
Of course, you could add more functionality to that using the drop shadow class as your base class, and some checks your could throw in there. But that should give you and over all idea on how to start.
Andy |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Sun Jun 29, 2003 11:57 am Post subject: |
|
|
Thanks ya so much
And this is what i've just done
not too bad 
Last edited by speak-up on Mon Sep 08, 2003 12:38 pm; edited 2 times in total |
|
Back to top |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Sun Jun 29, 2003 1:33 pm Post subject: |
|
|
speak-up wrote: | Thanks ya so much
And this is what i've just done... |
Groovy! Is that you? Btw, like the live chat phpBB mod on your website - where'd you find that?
Andy |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
|
Back to top |
|
 |
surffreak[.tk] Newbie
Joined: 07 Aug 2003 Posts: 1 Location: Belgium
|
Posted: Thu Aug 07, 2003 11:02 am Post subject: |
|
|
hey speak-upn, how does your tm4eva.php file looks? Can you give me the code pleaze
Thx |
|
Back to top |
|
 |
speak-up Newbie
Joined: 19 Jun 2003 Posts: 8
|
Posted: Mon Sep 08, 2003 12:28 pm Post subject: |
|
|
PHP: | <?php
list($x, $y) = explode(',', $_GET['size']);
include "class.dropshadow.php";
$ds = new dropShadow(FALSE);
$ds->setShadowPath('./');
$ds->loadImage('./'.$_GET['input']);
if ($x || $y) $ds->{$_GET['show']}($x, $y);
$ds->$show($x, $y);
if ($_GET['shadow'] == 1)
{
$ds->applyShadow($_GET['colour']);
$ds->showShadow('jpg');
}
else $ds->showFinal('jpg');
?> |
Here it is .. hope to help ya ... if u did send pm me, i think i could answer u earlier , anyway hope that i still could please you
Cheer |
|
Back to top |
|
 |
|