Can you tell me what am I doing wrong?
On the basis of that description, no.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
Error reports that there is no png function in GD::Image... I looked it up and there really isn't any... But http://search.cpan.org/~lds/GD-2.44/GD.pm says that there should be... Actually they have example same as your code (which I just copied)
P.S. i forgot to ask... what does rgb2n function do? and will it work without it?
P.P.S. still not working, but i did it manualy with printing in .ppm file
| [reply] |
Error reports that there is no png function in GD::Image...
It probably means that when your copy of libgd was built, the required library for png support was not available.
P.S. i forgot to ask... what does rgb2n function do? and will it work without it?
Most of the color related methods in GD are for use with palettised images, where you allocate a palette entry with the RGB value for that color, and get a palette index returned. You then supply that index to the drawing commands.
For truecolor (24-bit color) images, you supply the RGB value, as an integer, directly to the drawing commands.
rgb2n() does the job of converting an RGB triple into an integer in the right format for truecolor images.
There might even be some built-in function for doing the same job, but if there is, it isn't obvious from the docs.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
Yes, I figured... Forgot to put error messages... Meanwhile, I figured it out... I think I did (about to test it)... Stupid mistakes... So stupid...
Thanks anyway, I'll try not to bother you anymore... :)
P.S. It works, but reports error: "Can't locate object method "png" via package "GD::Image" at ./uilab.pl line 21" :-/
P.P.S Code is c/p of your first reply
| [reply] |