html - Html5 Canvases Have Max Size - What about Images? -


html canvases have max sizes depending on device/browser. eg mobiles have 1000x1000 canvas max. images stored in memory? can these ram of phone/pc? can 'drawimage' large images these 1000x1000 canvases auto-cropping? (i don't have phone test specific device.)

the max size of image object browser or memory dependent.

more question...

the image object draw canvas can larger canvas.

this causes canvas become "viewport" image.

for example:

  • your canvas 1000x1000.
  • your image 1500x1500.

if image pixels cropped @ x>1000 , y>1000.

// canvas shows image pixels x=0-999 , y=0-999  drawimage(yourimage,0,0)  

if image pixels cropped @ x<200 & x>1200 , y<200 , y>1200.

// canvas shows image pixels x=200-1999 , y=200-1999  drawimage(yourimage,-200,-200) 

a mental exercise see how works imagine piece of paper rectangle "viewport" cut it. move larger-than-viewport image behind paper. part of image visible through viewport. can move image , different portion of image revealed in viewport.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -