This article is about creating watermark images and generating thumbnails (PHP), and now share to everyone, a friend in need can look
<?php/** * Generate watermark Picture *///1. Get Picture Resource $big = Imagecreatefromjpeg ('./kaola.jpg '); Big picture $small = Imagecreatefrompng ('./t1.png '); Watermark map//2. Get image Size list ($BW, $BH) = GetImageSize ('./kaola.jpg '); list ($w, $h) = GetImageSize ('./t1.png ');//imagecopymerge (Dst_im, Src_im, dst_x, dst_y, src_x, src_y, Src_w, Src_h, pct)//imagecopymerge ("Target graph", "watermark Map", "x-coordinate of the target graph", "y-coordinate", "X" of the watermark graph, "y "," Wide "," high "," transparency "); Imagecopymerge ($big, $small, $BW-$w, $BH-$h, 0, 0, $w, $h, imagepng); Imagedestroy ($ Big); Imagedestroy ($small); ##################################################################################/* * * Generate thumbnail image */$big = Imagecreatefromjpeg ('./kaola.jpg '); list ($w, $h) = GetImageSize ('./kaola.jpg ');//Create small canvas $small = IMAGECR Eatetruecolor ($w/2, $h/2);//copy image and modify size//imagecopyresampled (Dst_image, Src_image, dst_x, dst_y, src_x, src_y, Dst_w, DST _h, Src_w, Src_h) imagecopyresampled ($small, $big, 0, 0, 0, 0, $w/2, $h/2, $w, $h); Imagepng ($small, './t6.png '); imagedestr Oy ($big); Imagedestroy ($small);? >
function encapsulation
https://blog.csdn.net/liguanjie8/article/details/79835373