I really like that idea. But I think you'd put the method on <span>CanvasRenderingContext2D</span> instead of canvas itself?<br><br>foo.getContext("2d").drawElement(document.getElementById("ds1title"), 45, 60);
<br><br><br>In the latest Flash player, you can do something similar with BitmapData.draw(), but there are additional arguments for matrix transform, blending mode, clip rectangle and smoothing options. I'd certainly want to at least be able to scale and clip what I'm drawing.
<br><br>Peter<br><br><br><div><span class="gmail_quote">On 5/17/06, <b class="gmail_sendername">Gervase Markham</b> <<a href="mailto:gerv@mozilla.org">gerv@mozilla.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Lachlan Hunt wrote:<br>> That's unfortunate because text can often be an important part of an<br>> image. Consider a graph or chart generated from a table of data<br>> elsewhere in the page, it's important to correctly label the axis and
<br>> for such labels to remain in the image when it's exported to PNG (or any<br>> other image format).<br>><br>> Could this feature be considered for a future revision of the spec, if<br>> it's not going to make it into this one?
<br><br>This came up in Vlad's presentation at XTech today. My suggestion was to<br>implement drawDiv() or drawElement(), in addition to drawWindow(). That<br>way, you could fix the potentially hairy text rendering problem with one
<br>simple API call, which could be made using the backup accessible content<br>which you had placed inside the <canvas> tag anyway. Everyone wins.<br><br><canvas id="foo"><br> <table><br> <tr>
<br> <th id="ds1title">Data Set 1</th><br> <th id="ds2title">Data Set 2</th><br> ...<br><br>foo.drawElement(document.getElementById("ds1title"), 45, 60);
<br><br>(or something like that; you get the idea).<br><br>Gerv<br></blockquote></div><br>