国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? ??? ?? PHP ???? ?? ???? ??? ???? PHP ?? ??

?? ???? ??? ???? PHP ?? ??

Jul 25, 2016 am 08:46 AM

php類庫給現(xiàn)有的圖片加文字水印,代碼不是很完善,歡迎大家多多指教!代碼如下:

  1. /*PHP圖片加文字水印類庫
  2. QQ:3697578482 傷心的歌
  3. 該類庫暫時(shí)只支持文字水印,位置為右下角,顏色隨機(jī)
  4. 調(diào)用方法:
  5. 1、在需要加水印的文件頂部引入類庫:
  6. include_once 'imageClass.php';
  7. 2、聲明新類:
  8. $tpl=new image_fu;
  9. 3、給圖片水印提供參數(shù):
  10. $tpl->img(圖片路徑,水印文字,字體路徑,字體大小,字體角度);
  11. 比如:$tpl->img('abc.jpg','這是水印文字','ziti.ttf',30,0)
  12. */
  13. class image_fu{
  14. private $image;
  15. private $img_info;
  16. private $img_width;
  17. private $img_height;
  18. private $img_im;
  19. private $img_text;
  20. private $img_ttf='';
  21. private $img_new;
  22. private $img_text_size;
  23. private $img_jd;
  24. function img($img='',$txt='',$ttf='',$size=12,$jiaodu=0){
  25. if(isset($img)&&file_exists($img)){//檢測圖片是否存在
  26. $this->image =$img;
  27. $this->img_text=$txt;
  28. $this->img_text_size=$size;
  29. $this->img_jd=$jiaodu;
  30. if(file_exists($ttf)){
  31. $this->img_ttf=$ttf;
  32. }else{
  33. exit('字體文件:'.$ttf.'不存在!');
  34. }
  35. $this->imgyesno();
  36. }else{
  37. exit('圖片文件:'.$img.'不存在');
  38. }
  39. }
  40. private function imgyesno(){
  41. $this->img_info =getimagesize($this->image);
  42. $this->img_width =$this->img_info[0];//圖片寬
  43. $this->img_height=$this->img_info[1];//圖片高
  44. //檢測圖片類型
  45. switch($this->img_info[2]){
  46. case 1:$this->img_im = imagecreatefromgif($this->image);break;
  47. case 2:$this->img_im = imagecreatefromjpeg($this->image);break;
  48. case 3:$this->img_im = imagecreatefrompng($this->image);break;
  49. default:exit('圖片格式不支持水印');
  50. }
  51. $this->img_text();
  52. }
  53. private function img_text(){
  54. imagealphablending($this->img_im,true);
  55. //設(shè)定顏色
  56. $color=imagecolorallocate($this->img_im,rand(0,255),rand(0,255),rand(0,255));
  57. $txt_height=$this->img_text_size;
  58. $txt_jiaodu=$this->img_jd;
  59. $ttf_im=imagettfbbox($txt_height,$txt_jiaodu,$this->img_ttf,$this->img_text);
  60. $w = $ttf_im[2] - $ttf_im[6];
  61. $h = $ttf_im[3] - $ttf_im[7];
  62. //$w = $ttf_im[7];
  63. //$h = $ttf_im[8];
  64. unset($ttf_im);
  65. $txt_y =$this->img_height-$h;
  66. $txt_x =$this->img_width-$w;
  67. //$txt_y =0;
  68. //$txt_x =0;
  69. $this->img_new=@imagettftext($this->img_im,$txt_height,$txt_jiaodu,$txt_x,$txt_y,$color,$this->img_ttf,$this->img_text);
  70. @unlink($this->image);//刪除圖片
  71. switch($this->img_info[2]) {//取得背景圖片的格式
  72. case 1:imagegif($this->img_im,$this->image);break;
  73. case 2:imagejpeg($this->img_im,$this->image);break;
  74. case 3:imagepng($this->img_im,$this->image);break;
  75. default: exit('水印圖片失敗');
  76. }
  77. }
  78. //顯示圖片
  79. function img_show(){echo ''.$this->img_text.'';}
  80. //釋放內(nèi)存
  81. private function img_nothing(){
  82. unset($this->img_info);
  83. imagedestroy($this->img_im);
  84. }
  85. }
  86. ?>
復(fù)制代碼

PHP


? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1601
29
PHP ????
1502
276
???
PHP ?? ??? ??????? PHP ?? ??? ??????? Jul 17, 2025 am 04:16 AM

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP?? ?? ???? ???? ???? ??? ?????? PHP?? ?? ???? ???? ???? ??? ?????? Jul 08, 2025 am 02:37 AM

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP?? ?? ?? PHP?? ?? ?? Jul 18, 2025 am 04:57 AM

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP?? ???? ??? ?????? PHP?? ???? ??? ?????? Jul 11, 2025 am 03:12 AM

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

PHP ?? ?? ? PHP ?? ?? ? Jul 18, 2025 am 04:51 AM

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

?? PHP : ??? ??? ?? PHP : ??? ??? Jul 18, 2025 am 04:54 AM

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

PHP?? ??? ? ???? ??? ????? ?? PHP?? ??? ? ???? ??? ????? ?? Jul 12, 2025 am 03:15 AM

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

?? PHP ?? ??? ?? PHP ?? ??? Jul 18, 2025 am 04:52 AM

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2

See all articles