OZONE Asylum
Forums
DHTML/Javascript
Water effect
This page's ID:
31529
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
[b]racerX:[/b] Your code tries to drawImage(...) one line that is completely outside of the source image and therefore throws an INDEX_SIZE_ERR in proper implementations of Canvas. See the [url=http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage]Specification of CanvasRenderingContext2D.drawImage[/url][quote]If the source rectangle is not entirely within the source image, or if one of the sw or sh arguments is zero, the implementation must raise an INDEX_SIZE_ERR exception.[/quote] You'd better change your loop to something like:[code]for( var i=0; i<img.height; i++ ) { context.drawImage ( img, 0, i, img.width, 1, 40+Math.sin(4*(step+i/20.0))*(i/2.0), i, img.width, 1 ); }[/code]HTH [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_love_small.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_charly.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_dk.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_reason.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_galaxy.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_neon88x31.gif[/img]|[img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_teapot.png[/img][/sigrotate][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/2185]poi[/url] on 12-09-2009 17:05)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »