PHP 8.3.4 Released!

imageaffinematrixget

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

imageaffinematrixgetObtém uma matriz de transformação afim

Descrição

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

Retorna uma matriz de transformação afim.

Parâmetros

type

Uma das constantes IMG_AFFINE_*.

options

Se type for IMG_AFFINE_TRANSLATE ou IMG_AFFINE_SCALE, options deve ser um array com chaves x e y, ambas tendo valores float.

Se type for IMG_AFFINE_ROTATE, IMG_AFFINE_SHEAR_HORIZONTAL ou IMG_AFFINE_SHEAR_VERTICAL, options deve ser um float especificando o ângulo em graus.

Valor Retornado

Uma matriz de transformação afim (um array com chaves de 0 a 5 e valores float) ou false em caso de falha.

Exemplos

Exemplo #1 Exemplo de imageaffinematrixget()

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

O exemplo acima produzirá:

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

Veja Também

  • imageaffine() - Retorna uma imagem contendo a imagem fonte com transformação afim, usando uma área de recorte opcional
  • imageaffinematrixconcat() - Concatena duas matrizes de transformação afim
add a note

User Contributed Notes

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