2015-05-03 34 views
0

我正在使用以下片段:http://www.phpclasses.org/package/4254-PHP-Render-graphical-diagrams-of-hierarchical-trees.htmlphp图像创建功能是否有任何色彩问题?

而且我正在为每个节点添加一个png图像。如果我得到它的正确使用的代码是:

$strSourceImage = imagecreatefrompng($node->image); 
imagecopyresampled($this->img, $strSourceImage, $node->x, $node->y, 0, 0, $node->w, $node->h, $this->imgsize[0], $this->imgsize[1]); 

但PNG图像获得它的颜色改变,

这是原始图像:http://postimg.org/image/jz4hjej4f/2e34cb9e/ 这通过PHP增加时,它是结果:http://postimg.org/image/mzkw9uwlf/0959e1b9/

+0

你可能已经想通了,但可能是因为你需要使用'imagecreatetruecolor'函数 – Rasclatt

回答

0

明白了。 img是使用imagecreate()创建的,现在使用imagecreatetruecolor(),希望这可以帮助未来的人。

相关问题