{# canonical_base is the OWNING tenant's origin: all 16 Peasy domains serve the same catalogue, so a page rendered by a non-owner points its canonical at the owner instead of competing with it. Falls back to this site for static/self-owned pages. #}
🍋
Menu
General

Rendering

Rendering (การสร้างเอาต์พุตแบบภาพ)

กระบวนการสร้างเอาต์พุตแบบภาพหรือเสียงจากข้อมูลที่มีโครงสร้าง เช่น การแปลง HTML และ CSS เป็นหน้าเว็บที่มองเห็น คำสั่ง PDF เป็นภาพหน้า หรือโมเดล 3 มิติเป็นพิกเซลบนหน้าจอ

รายละเอียดทางเทคนิค

การ render ในเบราว์เซอร์เป็นไปตามไปป์ไลน์: การแยกวิเคราะห์ HTML สร้าง DOM tree, การแยกวิเคราะห์ CSS สร้าง CSSOM, ทั้งสองรวมกันเป็น render tree, layout คำนวณเรขาคณิต, painting เติมพิกเซล และ compositing วางซ้อนผลลัพธ์ การ render PDF ตีความ operator ของ content stream (การวางตำแหน่งข้อความ, graphics state, การวาดเส้นทาง) เพื่อสร้างภาพหน้า การ render บน Canvas ในเครื่องมือใช้ 2D context หรือ WebGL สำหรับการดำเนินการที่เร่งด้วยฮาร์ดแวร์ Offscreen rendering ผ่าน OffscreenCanvas หรือ Web Worker หลีกเลี่ยงการบล็อก main thread

ตัวอย่าง

```javascript
// Rendering: file processing example
const file = document.getElementById('fileInput').files[0];
const reader = new FileReader();
reader.onload = (e) => {
  const data = e.target.result;
  console.log(`Loaded: ${file.name} (${file.size} bytes)`);
};
reader.readAsArrayBuffer(file);
```

คำศัพท์ที่เกี่ยวข้อง