These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:12 pm Advanced search

How I do I get a string that has been drawn to canvas?

If you are stuck or have questions regarding HTML or other Web technologies, ask your questions here. No question too dumb!

How I do I get a string that has been drawn to canvas?

Postby arthur » Wed Sep 05, 2012 2:49 am

Hi!

How I do I get a string that has been drawn to canvas?

Code: Select all
var context = canvas.getContext("2d");
context.fillText("HelloWorld");


I want to get the string "HelloWorld"

Thank you.
arthur
<h6>
 
Posts: 1
Joined: Wed Sep 05, 2012 2:08 am

Re: How I do I get a string that has been drawn to canvas?

Postby zcorpan » Fri Sep 07, 2012 10:22 am

You have to keep a reference to the string manually. There's no way to get it back (short of reading the pixel data and applying OCR).
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden


Return to Help & Advice

Who is online

Users browsing this forum: No registered users and 1 guest