png文件能写入文字信息吗?解决办法

WBOY
Release: 2016-06-13 09:58:38
Original
930 people have browsed it

png文件能写入文字信息吗?
png文件能写入文字信息吗?
比如一个图片hello.png
我想在图片里面储存一些信息:
author: John
website : http://google.com
然后用一些特殊的工具查看这些信息。请问有没有这种可能性?

------解决方案--------------------

PHP code
<?php //创建图像  $imgname="aa.png";//你的图片路径+名字$image = imagecreatefrompng($imgname);   $text = 'AUTHOR:MM你好';//要写的文字$red = imagecolorallocate($image, 235, 20, 20);//调配颜色imagestring($image, 5, 0, 0, 'ABCDDFEFEF', $red);//非中文字体的string可以用这个函数添加$font = 'new.ttc';//字体文件 imagettftext($image, 20, 0, 100, 40, $red, $font, $text);//中文文字的添加用这个函数 //输出图像header('Content-type: image/png');imagepng($image);imagedestroy($image);<div class="clear">
                 
              
              
        
            
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template