Shanky
Shanky

Reputation: 203

How can i copy file in javascript from source path to destination path

I am using HTML5 and javascript in a project. I am loading image from a Url(seleted by user) and then i am moving that image inside canvas. On moving i am redrawing the whole image. But on moving image is flickering. So i want to copy that file from URL to my working directory. So that flickering of image on moving would get stop.

Is there any other way to do this? if not then how can i copy that image file in my working follder(i.e. destination path).

Thanks a lot in advance.

Upvotes: 0

Views: 681

Answers (2)

Maurice
Maurice

Reputation: 27632

This article will give you some good pointers to optimizing your canvas code. Make sure you take a good look at the section titled: Pre-render to an off-screen canvas.

Upvotes: 1

Alex
Alex

Reputation: 3791

You probably are facing crossdomain limitations when using images in canvas. The image and the html document must reside on the same server/domain otherwise you have to base64 encode the image as the image source.

Upvotes: 0

Related Questions