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B/9k=PHP ile bir alan oluşturup daha sonra karenin tasarımını gerçekleştireceğiz. Bunun için öncelikle grafik oluşturacağımızı sunucumuza belirtelim. Daha sonra yükseklik, genişlik ve son olarak ise rengini belirleyeceğiz.

<?php

header(“content-type: image/jpg”);

$yukseklik=100;

$genislik=100;

$resim=ImageCreate($genislik,$yukseklik);

$zemin=ImageColorAllocate($resim,0,0,1);

// Zemin rengini “1”rakımını yükselterek değiştirebilirsiniz.

Imagefill($resim,0,0,$zemin);

Imagejpeg($resim);

?>

Önizleme:

Author: Ali Göksel Bektaş

Simenty kurucu ortağı. Küçüklüğünden beri website yapan Ali bulunduğu web sektöründe 10 yıldan fazla tecrübesı vardır. Bisiklet sürmeyi, kek yemeyi ve rahat koltukları sever.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.