GD with php

This is a discussion on GD with php within the PHP Language forums, part of the PHP Programming Forums category; I am trying to use gd to make a wind direction compass. Is is possbile to merge the picture of ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-01-2006
timlitw@gmail.com
 
Posts: n/a
Default GD with php

I am trying to use gd to make a wind direction compass.

Is is possbile to merge the picture of the compass with the picture of
the compass needle rotateing the needle as needed ofr each rendering?

Reply With Quote
  #2 (permalink)  
Old 07-02-2006
Janwillem Borleffs
 
Posts: n/a
Default Re: GD with php

timlitw@gmail.com wrote:
> I am trying to use gd to make a wind direction compass.
>
> Is is possbile to merge the picture of the compass with the picture of
> the compass needle rotateing the needle as needed ofr each rendering?
>


Yep, example source can be found here:

http://playground.jwscripts.com/imagerotate.phps

The source also contains URLs to a demo application.


JW


Reply With Quote
  #3 (permalink)  
Old 07-02-2006
timlitw@gmail.com
 
Posts: n/a
Default Re: GD with php


Janwillem Borleffs wrote:
> timlitw@gmail.com wrote:
> > I am trying to use gd to make a wind direction compass.
> >
> > Is is possbile to merge the picture of the compass with the picture of
> > the compass needle rotateing the needle as needed ofr each rendering?
> >

>
> Yep, example source can be found here:
>
> http://playground.jwscripts.com/imagerotate.phps
>
> The source also contains URLs to a demo application.
>
>
> JW


Thanks very much for that. I had found a clock and modified that - and
got this far
http://www.qffinc.com/scripts/compass.php?windir=300

but I think with a few modification this example will get me further.

Reply With Quote
  #4 (permalink)  
Old 07-02-2006
timlitw@gmail.com
 
Posts: n/a
Default Re: GD with php


timlitw@gmail.com wrote:
> Janwillem Borleffs wrote:
> > timlitw@gmail.com wrote:
> > > I am trying to use gd to make a wind direction compass.
> > >
> > > Is is possbile to merge the picture of the compass with the picture of
> > > the compass needle rotateing the needle as needed ofr each rendering?
> > >

> >
> > Yep, example source can be found here:
> >
> > http://playground.jwscripts.com/imagerotate.phps
> >
> > The source also contains URLs to a demo application.
> >
> >
> > JW

>
> Thanks very much for that. I had found a clock and modified that - and
> got this far
> http://www.qffinc.com/scripts/compass.php?windir=300
>
> but I think with a few modification this example will get me further.


It still needs some work - rotateing the pointer for nne ne and ene ofr
example leave artifacts. you can see it here
http://www.qffinc.com/weather/hillsboro/test.php

Reply With Quote
  #5 (permalink)  
Old 07-02-2006
Geoff Berrow
 
Posts: n/a
Default Re: GD with php

Message-ID: <1151819563.790025.269390@75g2000cwc.googlegroups. com> from
timlitw@gmail.com contained the following:

>It still needs some work - rotateing the pointer for nne ne and ene ofr
>example leave artifacts. you can see it here
>http://www.qffinc.com/weather/hillsboro/test.php



Give your server a break. Each time you generate and image, store it.
then check if the image exists before generating a new one. Eventually
you will have 360 images and won't need to create any more. Or just
write a loop to generate 360 images in one go.

Though to be honest, I doubt you can measure wind direction to an
accuracy of one degree anyway. A display to the nearest 5 degrees would
probably do just as well.
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #6 (permalink)  
Old 07-02-2006
timlitw@gmail.com
 
Posts: n/a
Default Re: GD with php


Geoff Berrow wrote:
> Message-ID: <1151819563.790025.269390@75g2000cwc.googlegroups. com> from
> timlitw@gmail.com contained the following:
>
> >It still needs some work - rotateing the pointer for nne ne and ene ofr
> >example leave artifacts. you can see it here
> >http://www.qffinc.com/weather/hillsboro/test.php

>
>
> Give your server a break. Each time you generate and image, store it.
> then check if the image exists before generating a new one. Eventually
> you will have 360 images and won't need to create any more. Or just
> write a loop to generate 360 images in one go.
>
> Though to be honest, I doubt you can measure wind direction to an
> accuracy of one degree anyway. A display to the nearest 5 degrees would
> probably do just as well.
> --
> Geoff Berrow (put thecat out to email)
> It's only Usenet, no one dies.
> My opinions, not the committee's, mine.
> Simple RFDs http://www.ckdog.co.uk/rfdmaker/



actually , n, nne, ne, ene, e, ese, se, sse, s ssw, sw, wsw, w wnw, nw,
nnw are all that are really needed. We don't actually have to be more
acurate than that.

So how do I check if I already have the image ot not?

Reply With Quote
  #7 (permalink)  
Old 07-02-2006
Geoff Berrow
 
Posts: n/a
Default Re: GD with php

Message-ID: <1151866129.908244.297340@p79g2000cwp.googlegroups .com> from
timlitw@gmail.com contained the following:

>actually , n, nne, ne, ene, e, ese, se, sse, s ssw, sw, wsw, w wnw, nw,
>nnw are all that are really needed. We don't actually have to be more
>acurate than that.
>
>So how do I check if I already have the image ot not?


file_exists()

But for just sixteen images, I'd simply create them in a paint program.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Reply With Quote
  #8 (permalink)  
Old 07-02-2006
Krustov
 
Posts: n/a
Default Re: GD with php

<comp.lang.php>
<timlitw@gmail.com>
<2 Jul 2006 11:48:49 -0700>
<1151866129.908244.297340@p79g2000cwp.googlegroups .com>

> actually , n, nne, ne, ene, e, ese, se, sse, s ssw, sw, wsw, w wnw, nw,
> nnw are all that are really needed. We don't actually have to be more
> acurate than that.
>
> So how do I check if I already have the image ot not?
>


$pass=1;
$filename="images/demo.jpg";
if (!file_exists($filename)) {$pass=0;}
if ($pass==0) {include('create_map_image.php');}

If a image isnt found then $pass will equal 0


--
www.emailuser.co.uk/?name=KRUSTOV
Reply With Quote
  #9 (permalink)  
Old 07-03-2006
timlitw@gmail.com
 
Posts: n/a
Default Re: GD with php


Krustov wrote:
>
> $pass=1;
> $filename="images/demo.jpg";
> if (!file_exists($filename)) {$pass=0;}
> if ($pass==0) {include('create_map_image.php');}
>
> If a image isnt found then $pass will equal 0



Thank you everyone for the help!

Reply With Quote
  #10 (permalink)  
Old 07-28-2006
timlitw@gmail.com
 
Posts: n/a
Default Re: GD with php

Now I need to add, high and low hands to my gauges.

When I duplicate the code the writes the hand it still doesn't get in
the final image.

I'm guessing that I need to increment the temporary image that I am
working with as I add layers.

Does any one have an example of adding 2 or 3 layers on top of an
image?

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0