samedi 31 juillet 2021

Rounded Image Using Laravel Intervetion

I want to Make a rounded corner image in laravel intervention. Please help me out.

enter image description here

$image = Image::make($user['profile_pic'])->fit(300, 300, function ($constraint){
            $constraint->aspectRatio();
            });
            $image->encode('png');
            $width = $image->getWidth();
            $height = $image->getHeight();
            $mask = Image::canvas($width, $height);
        // draw a white circle
            $mask->circle(280, $width / 2, $height / 2, function ($draw) 
           {
                $draw->background('#fff');
            });
            $image->mask($mask, false);
            $img->insert($image, 'top-left', 50, 48);

Make a circle Using the Above code, I want to make in rounded corner Image. Thank you in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire