The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Make Canvas Responsive to Pixel Ratio

Make Canvas Responsive to Pixel Ratio

1:06
Canvas is great for high performance graphics rendering but by default the results look blocky on phones tablets and laptops with high pixel density or Retina displays. By using canvas width and height attributes and style props we can use `window.devicePixelRatio` to create a canvas that is responsive to pixel ratio.
Watch this lesson now
Avatar
egghead.io

Canvas is great for high performance graphics rendering but by default the results look blocky on phones tablets and laptops with high pixel density or Retina displays. By using canvas width and height attributes and style props we can use window.devicePixelRatio to create a canvas that is responsive to pixel ratio.

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?