Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. var canvas = document.createElement('canvas');
  2. canvas.width = 2000;
  3. canvas.height = 200;
  4. canvas.style.display = 'inline';
  5.  
  6. var ctx = canvas.getContext('2d');
  7. ctx.rect(0, 0, 10, 10);
  8. ctx.rect(2, 2, 6, 6);
  9.  
  10. ctx.textBaseline = 'alphabetic';
  11. ctx.fillStyle = '#f60';
  12. ctx.fillRect(125, 1, 62, 20);
  13. ctx.fillStyle = '#069';
  14. ctx.font = '11pt no-real-font-123';
  15. ctx.fillText('Cwm fjordbank glyphs vext quiz, \ud83d\ude03', 2, 15);
  16. ctx.fillStyle = 'rgba(102, 204, 0, 0.2)';
  17. ctx.font = '18pt Arial';
  18. ctx.fillText('Cwm fjordbank glyphs vext quiz, \ud83d\ude03', 4, 45);
  19. ctx.globalCompositeOperation = 'multiply';
  20. ctx.fillStyle = 'rgb(255,0,255)';
  21. ctx.beginPath();
  22. ctx.arc(50, 50, 50, 0, Math.PI * 2, true);
  23. ctx.closePath();
  24. ctx.fill();
  25. ctx.fillStyle = 'rgb(0,255,255)';
  26. ctx.beginPath();
  27. ctx.arc(100, 50, 50, 0, Math.PI * 2, true);
  28. ctx.closePath();
  29. ctx.fill();
  30. ctx.fillStyle = 'rgb(255,255,0)';
  31. ctx.beginPath();
  32. ctx.arc(75, 100, 50, 0, Math.PI * 2, true);
  33. ctx.closePath();
  34. ctx.fill();
  35. ctx.fillStyle = 'rgb(255,0,255)';
  36. ctx.arc(75, 75, 75, 0, Math.PI * 2, true);
  37. ctx.arc(75, 75, 25, 0, Math.PI * 2, true);
  38. ctx.fill('evenodd');
  39.  
  40. canvas.toDataURL();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement