Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

TP picture how to deal with class add picture ellipse processing

Shulou Source: shulou.com Published: 2022-06-02 08:10:24 10月04日 Update

This article introduces the relevant knowledge of "how to deal with TP pictures and add picture ellipse processing". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

/ * deal with fillet images * @ param integer $radius fillet radius is 50 by default, processed as a circle * / public function radius ($radius = 50) {/ / $wh = getimagesize ($imgpath); $w = $this- > width (); $h = $this- > height (); / / $radius = $radius = = 0? (min ($w, $h) / 2): $radius; $img = imagecreatetruecolor ($w, $h); / / this sentence must have imagesavealpha ($img, true); / / pick a completely transparent color, and the last parameter 127is fully transparent $bg = imagecolorallocatealpha ($img, 255,255,255,127); imagefill ($img, 0,0, $bg); $r = $radius / / fillet radius for ($x = 0; $x

< $w; $x++) { for ($y = 0; $y < $h; $y++) { $rgbColor = imagecolorat($this->

Im, $x, $y); if (($x > = $radius & & $x = $radius & & $y)

Tags: Center coordinates processing picture ellipse content radius fillet more knowledge scope practicality learning next code parameters dilemma reality situation copy Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB OPPO Reno MySQL Huawei macOS