downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imagedestroy> <imagecreatetruecolor
Last updated: Fri, 13 Nov 2009

view this page in

imagedashedline

(PHP 4, PHP 5)

imagedashedlineKesikli çizgi çizer

Açıklama

bool imagedashedline ( resource $resim , int $x1 , int $y1 , int $x2 , int $y2 , int $renk )

Bu işlevin kullanımı önerilmemektedir. Yerine imagesetstyle() ve imageline() çiftini kullanın.

Değiştirgeler

resim

imagecreatetruecolor() gibi bir resim oluşturma işlevinden dönen bir resim verisi.

x1

Sol üst köşenin X konumu.

y1

Sol üst köşenin Y konumu. Resmin sol üst köşesinin koordinatları 0, 0'dır.

x2

Sağ alt köşenin X konumu.

y2

Sağ alt köşenin Y konumu.

renk

Dolgu rengi. imagecolorallocate() ile döndürülen bir renk tanıtıcısı.

Dönen Değerler

Daima TRUE döner.

Örnekler

Örnek 1 - imagedashedline() örneği

<?php
// 100x100 bir tuval oluşturalım
$im imagecreatetruecolor(100100);
$white imagecolorallocate($im0xFF0xFF0xFF);

// Dikine bir kesikli çizgi çizelim
imagedashedline($im50255075$white);

// Resmi kaydedelim
imagepng($im'./dashedline.png');
imagedestroy($im);
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

Örnek 2 - Başka bir imagedashedline() örneği

<?php
// 100x100 bir tuval oluşturalım
$im imagecreatetruecolor(100100);
$white imagecolorallocate($im0xFF0xFF0xFF);

// Çizgi tarzını taımlayalım: İlk dört piksel beyaz,
// sonraki dört piksel renksiz. Bu, kesikli çizgi etkisi verir.
$style = Array(
                
$white,
                
$white,
                
$white,
                
$white,
                
IMG_COLOR_TRANSPARENT,
                
IMG_COLOR_TRANSPARENT,
                
IMG_COLOR_TRANSPARENT,
                
IMG_COLOR_TRANSPARENT
                
);

imagesetstyle($im$style);

// Kesikli çizgimizi çizelim
imageline($im50255075IMG_COLOR_STYLED);

// Resmi kaydedelim
imagepng($im'./imageline.png');
imagedestroy($im);
?>

Ayrıca Bakınız



imagedestroy> <imagecreatetruecolor
Last updated: Fri, 13 Nov 2009
 
add a note add a note User Contributed Notes
imagedashedline
ProfessorNeo at gmx dot de
16-Feb-2006 08:07
The bug reported by 'michi at marel dot at' also exists in PHP version 5.1.1. This functions just works with vertical lines!
alien-scripts.de
13-Jul-2005 09:17
I make my own dashedline:

<?
for($l=50;$l<=550;$l+=5)
   {
    if($da == 0) { $da = 1; }
    elseif($da == 1){
    imageline($bild,$l,50,$l+5,50,$green);
    $da = 0; }
   }
?>

$l is the x-value
and we have a dashed line :)
michi at marel dot at
19-Nov-2003 02:49
There's a bug till PHP 4.0.4 in this function. You can only draw vertical dashed lines. To draw other dashed lines you can set <ImageSetStyle> to a special dashed line and draw it by <ImageLine>.

Sample code:
<?php
function MDashedLine($image, $x0, $y0, $x1, $y1, $fg, $bg)
{
       
$st = array($fg, $fg, $fg, $fg, $bg, $bg, $bg, $bg);
       
ImageSetStyle($image, $st);
       
ImageLine($image, $x0, $y0, $x1, $y1, IMG_COLOR_STYLED);
}
?>

imagedestroy> <imagecreatetruecolor
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites