Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-type:image/jpeg");
- $gb= imagecreate(500,500);
- $bg_color= imagecolorallocate($gb,0,0,0);
- $line_color= imagecolorallocate($gb,255,255,255);
- //garis_hoizontal
- $width= 400;//dalam pixel
- $x_mulai=20;
- $y_mulai=50;
- $x_akhir= $width+$x_mulai;
- imageline($gb,$x_mulai,$y_mulai,$x_akhir,$y_mulai,$line_color);
- //garis vertikal
- $y_akhir=$width+$y_mulai;
- imageline($gb,$x_mulai,$y_mulai,$x_mulai,$y_akhir,$line_color);
- //garis diagonal
- imageline($gb,$x_mulai,$y_mulai,$x_akhir,$y_akhir,$line_color);
- imagejpeg($gb);
- imagedestroy($gb);
- ?>
- #===============================================================================================================================
- <?php
- function garisPutus($gb,$x1,$y1,$x2,$y2,$fg,$bg){
- $string= array($fg,$fg,$fg,$fg,$bg,$bg,$bg,$bg);
- imagesetstyle($gb,$string);
- imageline($gb,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED);
- }
- header("Content-type:image/jpeg");
- $gb= imagecreate(500,500);
- $bg_color= imagecolorallocate($gb,0,0,0);
- $line_color= imagecolorallocate($gb,255,255,255);
- //garis_horisontal
- garisPutus($gb,20,50,320,50,$line_color,$bg_color);
- //garis_vertikal
- garisPutus($gb,20,50,20,320,$line_color,$bg_color);
- //garis_diagonal
- garisPutus($gb,20,50,320,320,$line_color,$bg_color);
- imagejpeg($gb);
- imagedestroy($gb);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement