Epson TM-T70-i ePOS-Print API Users Manual For TM-i firmware 4.1 - Page 52
Rendering in HTML5 Canvas
View all Epson TM-T70-i manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 52 highlights
Rendering in HTML5 Canvas Render an image in HTML5 Canvas. Rendering in HTML5 Canvas TITLE function drawCanvas() { // Rendering in HTML5 Canvas // var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); // context.clearRect(0, 0, 512, 480); context.drawImage(document.getElementById('coffee'), 0, 0 , 512, 384); context.fillStyle = 'rgba(255, 255, 255, 0.5)'; context.fillRect(0, 0, 512, 480); context.fillStyle = 'rgba(0, 0, 0, 1.0)'; // context.drawImage(document.getElementById('wmark'), 0, 0); context.drawImage(document.getElementById('wmark'), 256, 324); // context.textAlign = 'center'; context.textBaseline = 'alphabetic'; context.font = 'bold normal normal 48px "Times New Roman", serif'; context.fillText('FREE Coffee', 256, 224); } Run 52