⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manipulate_char.php

📁 这是php专业项目实例开发一书的源代码,希望对大家有所帮助!
💻 PHP
字号:
<html>
  <head>
</head>
<body>
                              
<?php
         $img=ImageCreate(200,200);
         $bgcolor=ImageColorAllocate($img,200,200,200);
         $red=ImagecolorAllocate($img,255,0,0); 
         $green=ImagecolorAllocate($img,0,255,0); 
         $blue=ImagecolorAllocate($img,0,0,255); 
         $grey=ImagecolorAllocate($img,50,50,50); 
         $black=ImagecolorAllocate($img,0,0,0); 
                                                            
         ImageChar($img,0,20,20,"S",$red);
         ImageChar($img,1,20,40,"S",$green);
         ImageChar($img,2,20,60,"S",$blue);
         ImageChar($img,3,20,80,"S",$grey);
         ImageChar($img,4,20,100,"S",$black);
         ImageChar($img,5,20,120,"S",$red);
                                                            
         ImageCharUp($img,0, 20,160,"S",$red);
         ImageCharUp($img,1, 40,160,"S",$green);
         ImageCharUp($img,2, 60,160,"S",$blue);
         ImageCharUp($img,3, 80,160,"S",$grey);
         ImageCharUp($img,4,100,160,"S",$black);
         ImageCharUp($img,5,120,160,"S",$red);
                                                            
                                                            
         /*
        RGB Red = 0..255 , Green = 0..255 , Blue = 0..255.
        */

        ImageSetPixel($img,50,50,$pixelcolor);
        ImagePNG($img,"pic.png");
        ImageDestroy($img);
 ?>
<img src="pic.png" border=0>
</body>
 </html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -