GD2 Class

GD2 Class ne işe yarar ?

  • Bir resmin belirtilen boyutlarda ufaltmaya
  • Genişlik yada yüksekliği sabit olarak ufaltmaya
  • Resmin verilen koordinatlarını kesmeye
  • JPG , GIF , PNG olarak çevirmeye ve okumaya
  • Resimleri çevirmeye (90 derece sağa sola vb.)
  • Bir kaç resim efekti vermeye örneğin : negate, grayscale, edge detect, blur, adjust contrast and brightness, smooth, emboss, mean removal, ve rotate.

Nasıl Elde Edilir ?
 http://www.phpclasses.org/browse/package/3407.html adresinden

Örnek Kullanımı nasıl ?
resim ufaltma :

$gd = new GD2;
$gd->MaxSizeThumbnail("DSC_0096.jpg",250);

bu örnekte genişliği yada yüksekliği maksimum 250 pixel olacaktır resmin.

Tek boyut:

$gd = new GD2;
$gd->OneSizeThumbnail("test.jpg",120);

bu örnekte ise resim 120×120 oranında küçültülecektir.

Kesme işlemi

$gd= new GD2;
$gd->CropImage("DSC_0096.jpg",250,250,100,70);

verilen koordinat(100,70) ve boylarda (250×250) kesim işlemi yapılmıştır.

convert this post to pdf.
Etiketler : PHP, , , ,

Leave a Reply




*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation