By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

GD with php

P: n/a
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?

Jul 1 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
ti*****@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
Jul 2 '06 #2

P: n/a

Janwillem Borleffs wrote:
ti*****@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.

Jul 2 '06 #3

P: n/a

ti*****@gmail.com wrote:
Janwillem Borleffs wrote:
ti*****@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

Jul 2 '06 #4

P: n/a
Message-ID: <11**********************@75g2000cwc.googlegroups. comfrom
ti*****@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/
Jul 2 '06 #5

P: n/a

Geoff Berrow wrote:
Message-ID: <11**********************@75g2000cwc.googlegroups. comfrom
ti*****@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?

Jul 2 '06 #6

P: n/a
Message-ID: <11**********************@p79g2000cwp.googlegroups .comfrom
ti*****@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/
Jul 2 '06 #7

P: n/a
<comp.lang.php>
<ti*****@gmail.com>
<2 Jul 2006 11:48:49 -0700>
<11**********************@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
Jul 2 '06 #8

P: n/a

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!

Jul 3 '06 #9

P: n/a
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?

Jul 28 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.