PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, October 10, 2022

[FIXED] How to draw a circle in img using php?

 October 10, 2022     gd, php     No comments   

Issue

How to draw a circle in (100px top and 100px left) of img using php ?

Image URL : image.jpg

I want to load the img then draw a circle on the orginal content of it

Before :

alt text

After :

alt text


Solution

Take a look at imagefilledellipse

// Create a image from file.
$image = imagecreatefromjpeg('imgname.jpg');

// choose a color for the ellipse
$ellipseColor = imagecolorallocate($image, 0, 0, 255);

// draw the blue ellipse
imagefilledellipse($image, 100, 100, 10, 10, $ellipseColor);

// Output the image.
header("Content-type: image/jpeg");
imagejpeg($image);


Answered By - CarlG
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing