user475685
user475685

Reputation: 8319

Is it possible to display image using canvas?

I have an image stored in my local system and i want to display it using canvas, is it possible using img src or something? html uses img src to display images, i wanted to know if it is possible using canvas also?

Upvotes: 0

Views: 229

Answers (2)

YT Low
YT Low

Reputation: 21

Answer is YES! You can display images using Canvas API.

First of all, what you need to do is to create an image object in JavaScript, then display it using Canvas API - drawImage() function.For details, please read it here: http://www.onlywebpro.com/2011/07/09/html5-canvas-for-absolute-beginners-part-3/

Upvotes: 0

SpliFF
SpliFF

Reputation: 38976

Hmmm. Did you even try to answer this for yourself? It's well documented. The short answer is yes.

Upvotes: 2

Related Questions