Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> PHP
PHP
  1. วิธีการรับความสูงพิกเซลของตัวอักษรในแบบอักษรที่ระบุโดยใช้ฟังก์ชัน imagefontheight() ใน PHP

    imagefontheight() เป็นฟังก์ชันในตัวของ PHP ที่ใช้เพื่อรับความสูงในหน่วยพิกเซลของตัวอักษรในแบบอักษรที่ระบุ รูปแบบการใช้งาน (Syntax) int imagefontheight(int $font) พารามิเตอร์ imagefontheight() รับพารามิเตอร์เดียวคือ $font ซึ่งเก็บค่าแบบอักษร ค่า $font สามารถเป็น 1, 2, 3, 4, และ 5 สำหรับแบบอักษรในตัว

  2. PHP – ดึงความกว้าง Pixel ของอักขระใน Font ด้วย imagefontwidth()

    ฟังก์ชัน imagefontwidth() ใช้ดึงความกว้าง (pixel width) ของอักขระใน font ที่ระบุ รูปแบบการใช้งาน (Syntax) int imagefontwidth(int $font) พารามิเตอร์ $font – font identifier: 1-5 สำหรับ built-in fonts หรือ custom font จาก imageloadfont() ค่าที่คืนกลับ คืนความกว้างของอักขระใน pixel (integer) ตัวอย่าง

  3. PHP – ดึง Clipping Rectangle ด้วย imagegetclip()

    ฟังก์ชัน imagegetclip() ใช้ดึง clipping rectangle ปัจจุบัน คือพื้นที่ที่อนุญาตให้วาด pixel ได้ พื้นที่นอกเหนือจากนี้จะไม่มีการวาด รูปแบบการใช้งาน (Syntax) array imagegetclip(GdImage $image) พารามิเตอร์ $image – GdImage resource จาก imagecreatetruecolor() หรือฟังก์ชันสร้างภาพอื่นๆ ค่าที่คืนกลับ คืน

  4. PHP – ตรวจสอบ True Color Image ด้วย imageistruecolor()

    ฟังก์ชัน imageistruecolor() ใช้ตรวจสอบว่ารูปภาพที่กำหนดเป็น true-color image หรือไม่ True-color image แต่ละ pixel ระบุค่าสีด้วย RGB (Red, Green, Blue) รูปแบบการใช้งาน (Syntax) bool imageistruecolor(GdImage $image) พารามิเตอร์ $image – รูปภาพที่ต้องการตรวจสอบ ค่าที่คืนกลับ คืน true หากเป็น true-col

  5. PHP – ตั้งค่า Alpha Blending Layer Effect ด้วย imagelayereffect()

    ฟังก์ชัน imagelayereffect() ใช้ตั้งค่า alpha blending flag สำหรับ layering effects ต่างๆ รูปแบบการใช้งาน (Syntax) bool imagelayereffect(GdImage $image, int $effect) พารามิเตอร์ $image – GdImage resource $effect – effect constant: IMG_EFFECT_REPLACE – pixel replacement (เหมือน imagealphablend

  6. PHP – วาดเส้นด้วย imageline()

    ฟังก์ชัน imageline() ใช้วาดเส้นตรงระหว่างจุดสองจุดที่กำหนด รูปแบบการใช้งาน (Syntax) bool imageline(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color) พารามิเตอร์ $image – GdImage resource $x1, $y1 – พิกัดจุดเริ่มต้น $x2, $y2 – พิกัดจุดสิ้นสุด $color – สีเส้น (จาก imagecolorallocate())

  7. PHP – วาด Open Polygon ด้วย imageopenpolygon()

    ฟังก์ชัน imageopenpolygon() ใช้วาด open polygon (ไม่ปิดท้าย) บนรูปภาพที่กำหนด รูปแบบการใช้งาน (Syntax) bool imageopenpolygon(GdImage $image, array $points, int $num_points, int $color) พารามิเตอร์ $image – GdImage resource $points – array ของพิกัด [x1, y1, x2, y2, ...] $num_points – จำนวน vertices

  8. PHP – คัดลอก Palette ระหว่างรูปภาพด้วย imagepalettecopy()

    ฟังก์ชัน imagepalettecopy() ใช้คัดลอก color palette จากรูปภาพหนึ่งไปยังอีกรูปหนึ่ง คัดลอกจาก source ไป destination รูปแบบการใช้งาน (Syntax) void imagepalettecopy(GdImage $destination, GdImage $source) พารามิเตอร์ $destination – รูปภาพปลายทาง $source – รูปภาพต้นทาง ค่าที่คืนกลับ ไม่คืนค่า (void) ตั

  9. PHP – ดึง/ตั้งค่า Resolution ของรูปภาพด้วย imageresolution()

    ฟังก์ชัน imageresolution() ใช้ดึงหรือตั้งค่า resolution (DPI - dots per inch) ของรูปภาพ หากไม่ระบุพารามิเตอร์เพิ่มเติม จะคืนค่า resolution ปัจจุบันเป็น indexed array หากระบุพารามิเตอร์เดียว จะตั้งค่า width และ height ให้เท่ากับค่านั้น Resolution ใช้เป็น meta information เท่านั้นเมื่ออ่าน/เขียนไฟล์ที

  10. PHP – หมุนรูปภาพด้วย imagerotate()

    ฟังก์ชัน imagerotate() ใช้หมุนรูปภาพตามมุมที่กำหนด (องศา) ทิศทางตรงข้ามเข็มนาฬิกา (counter-clockwise) รูปแบบการใช้งาน (Syntax) GdImage|false imagerotate(GdImage $image, float $angle, int $bgd_color, int $ignore_transparent = 0) พารามิเตอร์ $image – GdImage resource $angle – มุมการหมุน (องศา) หมุนทว

  11. PHP – ตั้งค่า Line Style ด้วย imagesetstyle()

    ฟังก์ชัน imagesetstyle() ใช้ตั้งค่า style สำหรับการวาดเส้น ใช้ร่วมกับ imagepolygon() หรือ imageline() รูปแบบการใช้งาน (Syntax) bool imagesetstyle(GdImage $image, array $style) พารามิเตอร์ $image – GdImage resource $style – array ของ pixel colors (สลับสีเพื่อสร้าง dashed line ฯลฯ) ค่าที่คืนกลับ คืน

  12. PHP – ตั้งค่า Tile Image สำหรับ Fill ด้วย imagesettile()

    ฟังก์ชัน imagesettile() ใช้ตั้งค่า tile image สำหรับการ fill พื้นที่ ใช้ร่วมกับ imagefill() และ imagefilledpolygon() เมื่อใช้สีพิเศษ IMG_COLOR_TILED Tile คือรูปภาพที่ใช้ fill แบบซ้ำ pattern ใดๆ ก็ได้ที่เป็น GD image รูปแบบการใช้งาน (Syntax) bool imagesettile(GdImage $image, GdImage $tile) พารามิเตอร

  13. PHP – วาดข้อความแนวนอนด้วย imagestring()

    ฟังก์ชัน imagestring() ใช้วาดข้อความ (string) แนวนอน (horizontal) บนรูปภาพ รูปแบบการใช้งาน (Syntax) bool imagestring(GdImage $image, int $font, int $x, int $y, string $string, int $color) พารามิเตอร์ $image – GdImage จาก imagecreatetruecolor() หรือ imagecreate() $font – font size 1-5 สำหรับ built-i

  14. PHP – วาดข้อความแนวตั้งด้วย imagestringup()

    ฟังก์ชัน imagestringup() ใช้วาดข้อความ (string) แนวตั้ง (vertical) บนรูปภาพ รูปแบบการใช้งาน (Syntax) bool imagestringup(GdImage $image, int $font, int $x, int $y, string $string, int $color) พารามิเตอร์ $image – GdImage จาก imagecreatetruecolor() $font – font size 1-5 สำหรับ built-in fonts หรือ fon

  15. PHP – ตั้งค่าความหนาเส้นด้วย imagesetthickness()

    ฟังก์ชัน imagesetthickness() ใช้ตั้งค่าความหนาของเส้นสำหรับการวาด (imageline, imagerectangle, ฯลฯ) รูปแบบการใช้งาน (Syntax) bool imagesetthickness(GdImage $image, int $thickness) พารามิเตอร์ $image – GdImage resource จาก imagecreatetruecolor() $thickness – ความหนาเป็น pixel ค่าที่คืนกลับ คืน true

  16. PHP – ตั้งค่า Pixel เดียวด้วย imagesetpixel()

    ฟังก์ชัน imagesetpixel() ใช้ตั้งค่าสีของ pixel เดียวที่พิกัดที่ระบุ รูปแบบการใช้งาน (Syntax) bool imagesetpixel(GdImage $image, int $x, int $y, int $color) พารามิเตอร์ $image – GdImage resource $x – x-coordinate ของ pixel $y – y-coordinate ของ pixel $color – สีของ pixel (จาก imagecolorallocate())

  17. PHP – เปิด/ปิด Interlace ด้วย imageinterlace()

    ฟังก์ชัน imageinterlace() ใช้เปิดหรือปิด interlace ในรูปภาพ Interlacing ทำให้เห็นภาพเบื้องต้นขณะโหลด (progressive loading) รูปแบบแตกต่างตาม image type JPEG non-interlaced โหลดทีละบรรทัด เรียกฟังก์ชันพารามิเตอร์ที่ 2 เป็น 1 เพื่อเปิด 0 เพื่อปิด รูปแบบการใช้งาน (Syntax) int imageinterlace(GdImage $ima

  18. PHP – ปรับแกมมาของ GD Image ด้วย imagegammacorrect()

    ฟังก์ชัน imagegammacorrect() ใช้ปรับ gamma correction ของ GD image โดยระบุ input gamma และ output gamma รูปแบบการใช้งาน (Syntax) bool imagegammacorrect(GdImage $image, float $inputgamma, float $outputgamma) พารามิเตอร์ $image – รูปภาพที่ต้องการปรับ $inputgamma – ค่า input gamma $outputgamma – ค่า o

  19. PHP – ใช้ 3×3 Convolution Matrix ด้วย imageconvolution()

    ฟังก์ชัน imageconvolution() ใช้ apply 3×3 convolution matrix พร้อม coefficient และ offset บนรูปภาพ รูปแบบการใช้งาน (Syntax) bool imageconvolution(GdImage $image, array $matrix, float $div, float $offset) พารามิเตอร์ $image – GdImage resource จาก imagecreatetruecolor() หรือฟังก์สร้างภาพอื่นๆ $matrix

  20. PHP – ตรวจสอบ Anti-aliasing ด้วย imageantialias()

    ฟังก์ชัน imageantialias() ใช้เปิด/ปิด และตรวจสอบสถานะ anti-aliasing สำหรับการวาดเส้นและ polygon แบบ wireframe ทำงานได้เฉพาะ true-color images ไม่รองรับ alpha component รูปแบบการใช้งาน (Syntax) bool imageantialias(GdImage $image, bool $enabled) พารามิเตอร์ $image – GdImage object จาก imagecreatetrue

Total 1286 -คอมพิวเตอร์  FirstPage PreviousPage NextPage LastPage CurrentPage:62/65  20-คอมพิวเตอร์/Page Goto:1 56 57 58 59 60 61 62 63 64 65