Gmagick::compositeimage

(PECL gmagick >= Unknown)

Gmagick::compositeimage β€” НакладываСт ΠΎΠ΄Π½ΠΎ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ Π½Π° Π΄Ρ€ΡƒΠ³ΠΎΠ΅

ОписаниС

public function Gmagick::compositeimage(
Β Β Β Β Gmagick $source,
Β Β Β Β int $COMPOSE,
Β Β Β Β int $x,
Β Β Β Β int $y
): Gmagick

ΠœΠ΅Ρ‚ΠΎΠ΄ Π½Π°ΠΊΠ»Π°Π΄Ρ‹Π²Π°Π΅Ρ‚ ΠΎΠ΄Π½ΠΎ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ Π½Π° Π΄Ρ€ΡƒΠ³ΠΎΠ΅ с Π·Π°Π΄Π°Π½Π½Ρ‹ΠΌ смСщСниСм.

Бписок ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ²

source
ΠžΠ±ΡŠΠ΅ΠΊΡ‚ Gmagick, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ содСрТит составноС ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅.
COMPOSE
ΠšΠΎΠΌΠΏΠΎΠ·ΠΈΡ‚Π½Ρ‹ΠΉ ΠΎΠΏΠ΅Ρ€Π°Ρ‚ΠΎΡ€.
x
Π‘ΠΌΠ΅Ρ‰Π΅Π½ΠΈΠ΅ столбца составного изобраТСния.
y
Π‘ΠΌΠ΅Ρ‰Π΅Π½ΠΈΠ΅ строки составного изобраТСния.

Π’ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅ΠΌΡ‹Π΅ значСния

ΠœΠ΅Ρ‚ΠΎΠ΄ Π²ΠΎΠ·Π²Ρ€Π°Ρ‰Π°Π΅Ρ‚ ΠΎΠ±ΡŠΠ΅ΠΊΡ‚ Gmagick с композициями.

Ошибки

Π’Ρ‹Π·Ρ‹Π²Π°Π΅Ρ‚ GmagickException, Ссли Π²ΠΎΠ·Π½ΠΈΠΊΠ»Π° ошибка.

οΌ‹Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ

ΠŸΡ€ΠΈΠΌΠ΅Ρ‡Π°Π½ΠΈΡ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ 2 notes

up
-3
wallace Lau kok poh ΒΆ
14 years ago
Quick script for stamping a small image on a large image

#!/usr/bin/php
<?php
//  <wallace@wallacelau.com>
//Instantiate a new Gmagick object
$imgMain = new Gmagick('Torso_F.tiff');

// get the image width
$width = (int) ($imgMain->getimagewidth() /2) - 150;

//Instantiate a barcode img Gmagick object
$imgBarcode = new Gmagick('barcode.jpeg');

//stamp the barcode on top of the Main image
$imgMain->compositeimage($imgBarcode, 1, $width, 150);
//Write the current image at the current state to a file
$imgMain->write('withBarcode.tiff');

?>
up
-4
Paul Janik ΒΆ
14 years ago
The second parameter, $COMPOSE, has 3 usable values:

1 = the image is displayed normally;
2 = the image is displayed on a white background;
3 = the image is display in black on a white background;

Paul.