<?php
$im = new \Imagick();
/* read image (914x784) */
$im->readImage($_SERVER['DOCUMENT_ROOT']."/path/toimage/".$inputfront);
$im->setImageBackgroundColor(new \ImagickPixel('transparent')); /* this is equal to -background none (in imagemagick command options ) */
/*Control points for the distortion in order to check weather setImageBackgound is working properly*/
$controlPoints = array( 0,0,
280,0,
994,0,
914,50,
994,862,
784,842,
0,862,
110,762);
/* Perform the distortion */
$im->distortImage(\Imagick::DISTORTION_PERSPECTIVE, $controlPoints, true);
/* Ouput the image */
$output_front_distort="Projects/path/where you want to store image/distorted_book.png";
header("Content-Type: image/png");
$im->writeImage($_SERVER['DOCUMENT_ROOT']."/designerr/public/".$output_front_distort);
?>
PHP.mk документација
Imagick::setImageBackgroundColor
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Патека
imagick.setimagebackgroundcolor.php
Локална патека за оваа страница.
Извор
php.net/manual/en
Оригиналниот HTML се реупотребува и локално се стилизира.
Режим
Прокси + превод во позадина
Кодовите, табелите и белешките остануваат читливи во истиот тек.
Референца
imagick.setimagebackgroundcolor.php
Imagick::setImageBackgroundColor
Референца за `imagick.setimagebackgroundcolor.php` со подобрена типографија и навигација.
Imagick::setImageBackgroundColor
(PECL imagick 2, PECL imagick 3)
Imagick::setImageBackgroundColor — Ја поставува бојата на позадината на сликата
= NULL
Ја поставува бојата на позадината на сликата.
Параметри
background-
Вратени вредности
Патеката до PHP скриптата што треба да се провери. true на успешен исход.
Errors/Exceptions
Фрла ImagickException при грешка.
Дневник на промени
| Верзија | = NULL |
|---|---|
| PECL imagick 2.1.0 | Now allows a string representing the color as the parameter. Previous versions allow only an ImagickPixel object. |
Белешки од корисници 1 белешка
mjunaidahmad at outlook dot com ¶
пред 8 години