The call to Stroke() function in pChart renders an Image. When I try to display开发者_JAVA技巧 this image on the browser, it shows something like the following instead of showing an image. How can I display the image instead of these wierd characters?
�PNG ��� IHDR����������h����tRNS������7X}�� �IDATx���wt[Y~'���C
H�Q�(�RV)TUW��v�}��cό�9�;g�xvv�;s��z����a�㝙 �v�cUu�����L�,Q)f��/��@E�� ���� ����.���{��W?"������P}�rW�������� !�����@�BB�����P�������T)$�������U !�����@�BB �����P�X˲�]������(!������RH������B��������������J!!������RH������ B��������������Jaaz������*�+�������U !�����@�BB�����P�������T)$�������U !�����@�BB �����P��!�����@�b˸������m����s��EA��0LE��^늧�2�
If you are outputting the image directly from a call to a PHP script, such as <img src="yourscript.php" />
then you're going to need to send the correct Content-Type
header:
header('Content-Length: '.filesize($yourimage));
header('Content-Type: image/png');
Note that any calls to header() must occur before output is started.
精彩评论