IMAGESCALE(3) 1 IMAGESCALE(3)imagescale - Scale an image using the given new width and heightSYNOPSIS
resource imagescale (resource $image, int $new_width, [int $new_height = -1], [int $mode = IMG_BILINEAR_FIXED])
DESCRIPTION imagescale(3) scales an image using the given interpolation algorithm.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $new_width
- The width to scale the image to.
o $new_height
- The height to scale the image to. If omitted or negative, the aspect ratio will be preserved.
Caution
You should always provide the height if using PHP 5.5.18 or earlier, or PHP 5.6.2 or earlier, as the aspect ratio calcula-
tion was incorrect.
o $mode
- One of IMG_NEAREST_NEIGHBOUR, IMG_BILINEAR_FIXED, IMG_BICUBIC, IMG_BICUBIC_FIXED or anything else (will use two pass).
RETURN VALUES
Return the scaled image resource on success or FALSE on failure.
CHANGELOG
+-------------+---------------------------------------------------+
| Version | |
| | |
| | Description |
| | |
+-------------+---------------------------------------------------+
|5.5.19/5.6.3 | |
| | |
| | The calculation of the height if $new_height was |
| | negative or omitted was fixed; prior to these |
| | versions, the aspect ratio was not maintained |
| | correctly. |
| | |
+-------------+---------------------------------------------------+
PHP Documentation Group IMAGESCALE(3)
Check Out this Related Man Page
IMAGEELLIPSE(3) 1 IMAGEELLIPSE(3)imageellipse - Draw an ellipseSYNOPSIS
bool imageellipse (resource $image, int $cx, int $cy, int $width, int $height, int $color)
DESCRIPTION
Draws an ellipse centered at the specified coordinates.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $cx
- x-coordinate of the center.
o $cy
- y-coordinate of the center.
o $width
- The ellipse width.
o $height
- The ellipse height.
o $color
- The color of the ellipse. A color identifier created with imagecolorallocate(3).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
imageellipse(3) example
<?php
// Create a blank image.
$image = imagecreatetruecolor(400, 300);
// Select the background color.
$bg = imagecolorallocate($image, 0, 0, 0);
// Fill the background with the color selected above.
imagefill($image, 0, 0, $bg);
// Choose a color for the ellipse.
$col_ellipse = imagecolorallocate($image, 255, 255, 255);
// Draw the ellipse.
imageellipse($image, 200, 150, 300, 200, $col_ellipse);
// Output the image.
header("Content-type: image/png");
imagepng($image);
?>
The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : imageellipse()
NOTES
Note
This function requires GD 2.0.2 or later.
SEE ALSO imagefilledellipse(3), imagearc(3).
PHP Documentation Group IMAGEELLIPSE(3)
How do I set X so that it has a 16:9 aspect ratio? I am trying to load it onto a display monitor, the bootloader and comand line run in 16:9 but when x starts it goes to a normal ratio. (0 Replies)
hello,
please can you help me.
jj and kk are two numbers which are the result of an sql program.
I would like to calculate the ratio jj/kk*100.
I have done this:
ratio=$((jj/kk * 100)) or ratio=`expr $jj \/ expr $kk) but the result is 0
What can i do?
Thanks for help. (3 Replies)
Hey All,
What I'm looking for is a way to rotate an image by non 90 degree angles (ie 90, 180, 270, 360). I am able to do it in PHP, but there are errors in the image, some pixels end up colored incorrectly and the image ends up resized and I lose transparency. I've done my share of searching on... (1 Reply)