ImagickDraw::setViewbox

(PECL imagick 2, PECL imagick 3)

ImagickDraw::setViewboxSets the overall canvas size

Beschreibung

public ImagickDraw::setViewbox(
    int $x1,
    int $y1,
    int $x2,
    int $y2
): bool
Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.

Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on.

Parameter-Liste

x1

left x coordinate

y1

left y coordinate

x2

right x coordinate

y2

right y coordinate

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 ImagickDraw::setViewBox() example

<?php
function setViewBox($strokeColor$fillColor$backgroundColor) {

    
$draw = new \ImagickDraw();

    
$draw->setStrokeColor($strokeColor);
    
$draw->setFillColor($fillColor);
    
$draw->setStrokeWidth(2);
    
$draw->setFontSize(72);

    
/*
     
    Sets the overall canvas size to be recorded with the drawing vector data. Usually this will be specified using the same size as the canvas image. When the vector data is saved to SVG or MVG formats, the viewbox is use to specify the size of the canvas image that a viewer will render the vector data on.
    
     */

    
$draw->circle(2502502500);
    
$draw->setviewbox(00200200);
    
$draw->circle(125250250250);
    
$draw->translate(250125);
    
$draw->circle(001250);


    
$imagick = new \Imagick();
    
$imagick->newImage(500500$backgroundColor);
    
$imagick->setImageFormat("png");

    
$imagick->drawImage($draw);

    
header("Content-Type: image/png");
    echo 
$imagick->getImageBlob();
}

?>

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Pharmaqo Labs

Discover Pharmaqo Labs (https://pharmaqolabs.us/), your trusted online store for injectables, orals, HGH, peptides, and SARMs. Shop high-quality p ...

Geschrieben von wycnik77 am 01.06.2026 14:16:07
Forum: Ankündigungen
Zypharix Labs | Buy Viagra, Tadalafil & Dapoxetine – Men’s ************ual Supplements

Zypharix Labs (https://zypharixlabs.us/) offers Viagra, Tadalafil & Dapoxetine online. Affordable prices, discreet delivery & guaranteed quality f ...

Geschrieben von tinhish am 01.06.2026 13:34:27
Forum: Ankündigungen
Pharmaqo | Buy Tirzepatide & Semaglutide – Trusted Peptides Products

Explore high-quality buy tirzepatide online (https://tirzepatide.to/), semaglutide, retatrutide and peptide products at PharmaQO Labs. Get detaile ...

Geschrieben von bzo0ham am 01.06.2026 12:49:12
Forum: Ankündigungen
Pharmaqo Labs | Safe Anabolic & Performance Support

Pharmaqo Labs (https://pharmaqolabs.store/) is a trusted provider of high-quality anabolic steroids, peptides, and performance-enhancing supplemen ...

Geschrieben von iletneils am 01.06.2026 11:59:55
Forum: Ankündigungen