PHP 8.5.0 Alpha 2 available for testing

imageaffinematrixget

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

imageaffinematrixgetObtener una matriz de transformación afín

Descripción

imageaffinematrixget(int $type, array|float $options): array|false

Devuelve una matriz de transformación afín.

Parámetros

type

Una constante entre IMG_AFFINE_*.

options

Si type es IMG_AFFINE_TRANSLATE o IMG_AFFINE_SCALE, options debe ser un array con las claves x y y, ambas con valores float.

Si type es IMG_AFFINE_ROTATE, IMG_AFFINE_SHEAR_HORIZONTAL o IMG_AFFINE_SHEAR_VERTICAL, options debe ser un valor float que especifique el ángulo.

Valores devueltos

Una matriz de transformación afín (un array con claves de 0 a 5 y números decimales como valores). o false si ocurre un error.

Ejemplos

Ejemplo #1 Ejemplo para imageaffinematrixget()

<?php
$matrix
= imageaffinematrixget(IMG_AFFINE_TRANSLATE, array('x' => 2, 'y' => 3));
print_r($matrix);
?>

El ejemplo anterior mostrará :

Array
(
    [0] => 1
    [1] => 0
    [2] => 0
    [3] => 1
    [4] => 2
    [5] => 3
)

Ver también

  • imageaffine() - Devuelve una imagen que contiene la imagen fuente transformada, utilizando opcionalmente una zona de recorte
  • imageaffinematrixconcat() - Concatena dos matrices de transformación afín
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top