<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=canvasgame@gmail.com href="mailto:canvasgame@gmail.com">Benjamin
Joffe</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=whatwg@whatwg.org
href="mailto:whatwg@whatwg.org">whatwg@whatwg.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, October 20, 2006 9:09
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [whatwg] Canvas draw
quality</DIV>
<DIV><FONT face=Arial size=2></FONT><BR></DIV>
<DIV>I would like to see a property added to the 2d canvas context that would
allow quality to be lowered for drawing functions. Normally any time a shape
is drawn, pixels close to the boundary are made semi transparent to make it
look smooth, this is usually favourable but I have had a need to draw shapes
and lines with pixel sharp boundaries in the same way as Java normally does. I
would imagine that with the setting enabled, only the integer part of
linewidth would be used. This setting would also affect drawing images, making
them have no blurring or approximating when scaled or rotated. <BR><BR>This
could easily be implemented without affecting old scripts, making a property
such as lowQuality = true; (default false). Or perhaps allowing more control:
a float from 0 (low quality) to 1 (high quality), and interperating null as 1
for backwards compatibility. <BR><BR>This property could also be handy in
instaces where both fill() and stroke() are being called. Low quality could be
used on the fill() to improve performace while stroke() could be used with
high quality so it still draws smoothly. </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BLOCKQUOTE>
<DIV><FONT face=Arial size=2>I think that the best way is just to define
different values for the context ID:</FONT></DIV><PRE>DOMObject <A href="http://www.whatwg.org/specs/web-apps/current-work/#getcontext">getContext</A>(in DOMString contextID);</PRE>
<DIV><FONT face=Arial size=2>Something like "2D" and "2D-fast" or
"2D-simple".</FONT></DIV>
<DIV><FONT face=Arial size=2>Another option would be to add one optional
parameter to the getContext() function.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I doubt that someone will need to switch it in the
middle of drawing so</FONT></DIV>
<DIV><FONT face=Arial size=2>having such switch as an attribute is
redundant. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Andrew Fedoniouk.</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://terrainformatica.com">http://terrainformatica.com</A></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><BR></DIV></BODY></HTML>