** การแสดงจุดลงบนรุปภาพ **

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: ** การแสดงจุดลงบนรุปภาพ **

โดย mindphp » 21/03/2007 11:30 am

ลอง ดู นะครับ

โดย kittija » 21/03/2007 9:33 am

ขอบคุรครับ :-D เดี่ยวลองทำดูแล้วจะรายงานผลนะครับ

โดย mindphp » 20/03/2007 4:01 pm

ลอง ดู ตัวอย่าง นี้
<?php

$x = 200;
$y = 200;

$gd = imagecreatetruecolor($x, $y);

$corners[0] = array('x' => 100, 'y' => 10);
$corners[1] = array('x' => 0, 'y' => 190);
$corners[2] = array('x' => 200, 'y' => 190);

$red = imagecolorallocate($gd, 255, 0, 0);

for ($i = 0; $i < 100000; $i++) {
imagesetpixel($gd, round($x),round($y), $red);
$a = rand(0, 2);
$x = ($x + $corners[$a]['x']) / 2;
$y = ($y + $corners[$a]['y']) / 2;
}

header('Content-Type: image/png');
imagepng($gd);

?>
ดูที่นี่ประกอบ
http://ptc.meelink.com/function.imagesetpixel.html

** การแสดงจุดลงบนรุปภาพ **

โดย kittija » 20/03/2007 3:01 pm

การแสดงจุดลงบนรุปภาพ ให้ค่า x/y มาจาก database mysql แล้วนำค่านั้นๆมาแสดงบนรุปภาพ ใครมีคำแนะนำหรือ sample code ช่วยหน่อยครับ

ขอบคุรครับ

ข้างบน