Matej Posted February 10, 2015 Share Posted February 10, 2015 Hello , im trying to shatter image to pieces using canvas here http://jsfiddle.net/Trolstover/qy5kcsmp/4/ , but as you can see the piece of shattered image isnt loaded why is that? there aint any error in console , i even tried using canvas.toDataURL() but didnt work; Link to comment Share on other sites More sharing options...
Ingolme Posted February 10, 2015 Share Posted February 10, 2015 This is what your Data URLs are looking like: blob:http://fiddle.jshell.net/d4f30ebe-6b19-449d-879e-1c9d13f4253e I don't really know how blob URLs are meant to work. Is this what you expected your program to make? toDataUrl() is probably the right solution: imagePieces.push(canvas.toDataURL()); But this triggers an error because the image is loaded from a different domain. In order for it to work the image and the HTML file need to be hosted on the same website. Link to comment Share on other sites More sharing options...
Matej Posted February 10, 2015 Author Share Posted February 10, 2015 Yes propably toDataURL() is the solution , i downloaded the picuture and tried to open it via deskop html file , but it aint working nor throwing any error Link to comment Share on other sites More sharing options...
Ingolme Posted February 11, 2015 Share Posted February 11, 2015 What does your code look like? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now