It is currently Sat Dec 02, 2017 4:04 pm
Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.
This is my code:
- Code: Select all
var canvas = document.getElementById('canvas'),
context = canvas.getContext('2d'),
image = new Image();
image.src = 'pattern_054.gif';
context.drawImage(image, 75, 220);
It works fine in Opra and FF but not Safari and Chrome, any ideas?
- Posts: 5
- Joined: Thu Jun 28, 2012 11:57 pm
You try to paint the image on the canvas before it has loaded. You need to wait for image.onload, then drawImage().
- Posts: 807
- Joined: Tue Feb 06, 2007 8:29 pm
- Location: Sweden
- Posts: 566
- Joined: Tue Mar 13, 2007 4:48 am
- Location: Sarasota Florida, USA
Return to General Discussion
Who is online
Users browsing this forum: No registered users and 1 guest