2
votes

I have a large image to draw in a canvas : 1900px X 7000px

80% it loads right, but 20% I have a black canvas instead of my image. Seems to be the Gpu, but not sure.

Do I have to split this img in two or three, or it won't change anything.

it's just a background image, without requestanimationframe on it.

just drawimage(bg, width, height, 0, 0)

1
How about some code and a reference to the large image :)markE
Check your syntax - it's supposed to be drawImage(bg,0,0,width,height).Albert Xing
You'll probably need to use a load event listener so that you know if the image has been loaded or not, and call drawImage only when it has been loaded. Can't tell you much else without some code or a fiddle.Rikonator

1 Answers

0
votes

If you're using this somewhere in your code

canvas.toDataURL()

use this instead:

canvas.toDataURL('image/jpg')