Size limit for imageellipse ?

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
Mike_Hunt
Forum Newbie
Posts: 2
Joined: Tue Apr 03, 2007 9:22 pm

Size limit for imageellipse ?

Post by Mike_Hunt »

Hello,

I am developing a PHP5 application using GD2 to dynamically create an image to be displayed on a web page. The image is fairly large, 1600px X 2400px, which is displayed in a smaller div with overflow set to auto so the image can be scrolled. This is for a game and the image is a map. On the map, I draw concentric circles equally spaced from the players position as a guide to how far they are from other point of interest.

The problem I am having is when I use imageellipse or imagearc and specify a height and width greater than 2050, the lines are distorted. Any size under 2050 is drawn correctly, but when I exceed it, the lines become very distorted.

I have tried the code on three computers, Linux, Win2000, and WinXP based, and the behavior persists on all three platforms.

Is there a limit to the size (height and width) that can be used with imageellipse or imagearc?

Thanks,

Mike
Mike_Hunt
Forum Newbie
Posts: 2
Joined: Tue Apr 03, 2007 9:22 pm

Post by Mike_Hunt »

On further testing, I discovered that if I used imagearc and specified start and ending degrees a 1-360 instead of 0-360, there was no distortion in the lines over 2050 width and height.

Perhaps there is a bug in GD2 drawing large 0-360 degree arcs?

I was able to solve my concentric rings drawing problem by making two calls to imagearc, the first specifying 0-180 degrees, and the second specifying 180-360 degrees.

Mike
Post Reply