PHP 设定画线的宽度

您所在的位置:网站首页 sin359 PHP 设定画线的宽度

PHP 设定画线的宽度

2023-12-22 10:14| 来源: 网络整理| 查看: 265

用户评论:

fred at nowhere dot fr (2009-10-10 12:05:08)

One thing worse to mention is that imagesetthikness() works on the next object you draw. For ex : you can draw a grid within a grapg with a thickness of 1 by invoking imagesetthickness($image, 1); ... script to draw your grid... and then invoke imagesetthikness with a draw your graph lines with a thickness of 3 imagesetthickness($image, 3); ... script to draw your graph lines... Hope this helps...

raffi dot semerciyan at gmail dot com (2009-09-24 08:42:09)

While recently "playing" with GD library for PHP I also encountered the problem of imagesetthickness not working with imageellipse. I think I found a good work around and wanted to share it  with you: Instead of using  I successfully used: NOTE: Don't put exactly 360 instead of 359.9 because it seems that the implementation makes the test and uses imageellipse instead! Below is my Ellipse function that is sensitive to imagesetthickness function AND that creates a properly closed ellipse.

jean-raymond dot chauviere at gmail dot com (2009-06-30 01:20:20)

An easier to manage thickness is, before to draw in the ellipse to play with 2 ellipse with different color : The first line draw a filled ellipse with the wanted color, and the 2nd one, draw an ellipse with the background color from the same center, but is smaller. The drawback of this method is that you erase everything in the middle of the ellipse.

admin at circle14 dot net (2009-02-01 17:33:29)

Here is a custom function I wrote that addresses the line thickness issues with ellipses : I hope you find this useful.

bpatru at gmail dot com (2008-09-28 13:01:34)

Apparently imagesetthickness doesn't work if antialiasing is set to true.

baldurien at bbnwn dot eu (2008-03-11 16:28:52)

The way that imagesetthickness works with imagerectangle() is pretty strange.This will draw a 41x41 square (because gd need the bottom right pixel, inclusive. 50 should get replaced by 49). This will "work" like:The second example:This will draw a 43x43 square because the border (thickness) is set to 2. *however* this is not a "regular" border of 2 pixels around the 41x41 original square! On the left and right, there will be a thickness of 3, while there we be a thickness of 2.If you take the imageline example, but set the thickness before to 2, this will *almost* do the trick: the left most pixel of the square will not be drawn.To conclude:1) do not forget that (width, height) of drawn rectangle is (x2-x1+1, y2-y1+1)2) thickness is bad implemented (or at least, the behavior i s not documented) on rectangle, as the left/right thickness is not the wanted one.3) 4*imageline() should do the trick, but after "patching" the top left pixel.

ab at cd dot com (2007-06-27 04:05:02)

Note: Also, for me (working under PHP 5.0.2) this function ONLY seems to work with imageline...

-private- (2007-03-28 01:01:28)

There is a known bug. Imagesetthickness is NOT working on ellipse.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3