Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-22-2012, 03:04 PM   PM User | #16
angelali
Regular Coder

 
Join Date: Sep 2011
Posts: 310
Thanks: 23
Thanked 0 Times in 0 Posts
angelali is an unknown quantity at this point
Oh by the way, y canvas issues have not been solved.

Anyway, is there a method, where you are writing on a DIV, using document.execcomand, then you press a button it saves the DIV as image? Sadly, document.execommand does not work on canvas. Even you can save Canvas as image, but to write on it now is a pain in the a**.
angelali is offline   Reply With Quote
Old 11-22-2012, 03:13 PM   PM User | #17
angelali
Regular Coder

 
Join Date: Sep 2011
Posts: 310
Thanks: 23
Thanked 0 Times in 0 Posts
angelali is an unknown quantity at this point
HOLY COW AND HOLY DEER! I know what I have to do. Simple lol, I will use Canvas to write. I put a textbox, give the value a variable, then put the variable in canvas and write like a BOSS.

Example:

Code:
<canvas id="canvas" width="200" height="200"></canvas>
<input type="text" size="25" id="lol"/>
<input type="button" value="write" onClick="writethecrap();"/>
Code:
<script>
function writethecrap () {
    var canvas = document.getElementById('canvas');
    var context = canvas.getContext('2d');
    var loltext = document.getElementById("lol").value;
    context.fillText(loltext, 20, 10);
}
</script>
Good?

Last edited by angelali; 11-22-2012 at 03:21 PM..
angelali is offline   Reply With Quote
Reply

Bookmarks

Tags
canvas, drawing, html5

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:37 PM.


Advertisement
Log in to turn off these ads.