<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: HTML 5 Canvas Lessons: Zooming and Reusing</title>
	<atom:link href="http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/feed/" rel="self" type="application/rss+xml" />
	<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/</link>
	<description></description>
	<lastBuildDate>Sat, 13 Mar 2010 16:48:29 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Joshua Koo</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3992</link>
		<dc:creator>Joshua Koo</dc:creator>
		<pubDate>Wed, 09 Dec 2009 06:19:45 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3992</guid>
		<description>I had a similar experience when I specified the canvas width with css rather than on the canvas object, making me wonder why the object on the canvas didn&#039;t seem to be the number of pixels specified, with some fuzzy lines :P</description>
		<content:encoded><![CDATA[<p>I had a similar experience when I specified the canvas width with css rather than on the canvas object, making me wonder why the object on the canvas didn&#8217;t seem to be the number of pixels specified, with some fuzzy lines <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drawing Crisp Lines on the HTML5 Canvas &#171; TheSoftwareFactory</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3478</link>
		<dc:creator>Drawing Crisp Lines on the HTML5 Canvas &#171; TheSoftwareFactory</dc:creator>
		<pubDate>Tue, 14 Apr 2009 19:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3478</guid>
		<description>[...] we started googling, but even then nothing really turned up. Until finally I found a blogpost by Ben Galbraith. The post seemed to describe the symptoms we encountered, but the cause was a different one - we [...]</description>
		<content:encoded><![CDATA[<p>[...] we started googling, but even then nothing really turned up. Until finally I found a blogpost by Ben Galbraith. The post seemed to describe the symptoms we encountered, but the cause was a different one &#8211; we [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe VG</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3460</link>
		<dc:creator>Christophe VG</dc:creator>
		<pubDate>Fri, 03 Apr 2009 10:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3460</guid>
		<description>Time to blame myself for not reading the documentation available: https://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors#A_lineWidth_example nicely explains why this is happening and how to resolve it.

The result boils down to:

var ctx = document.getElementById(&quot;canvas&quot;).getContext(&quot;2d&quot;);
ctx.save();
// not crisp
ctx.moveTo(25,10);
ctx.lineTo(25,90);
ctx.stroke();
// one way to solve it
ctx.fillRect(50,10,1,80);
// the right way to solve it
ctx.moveTo(75.5,10);
ctx.lineTo(75.5,90);
ctx.stroke();
ctx.restore();</description>
		<content:encoded><![CDATA[<p>Time to blame myself for not reading the documentation available: <a href="https://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors#A_lineWidth_example" rel="nofollow">https://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors#A_lineWidth_example</a> nicely explains why this is happening and how to resolve it.</p>
<p>The result boils down to:</p>
<p>var ctx = document.getElementById(&#8220;canvas&#8221;).getContext(&#8220;2d&#8221;);<br />
ctx.save();<br />
// not crisp<br />
ctx.moveTo(25,10);<br />
ctx.lineTo(25,90);<br />
ctx.stroke();<br />
// one way to solve it<br />
ctx.fillRect(50,10,1,80);<br />
// the right way to solve it<br />
ctx.moveTo(75.5,10);<br />
ctx.lineTo(75.5,90);<br />
ctx.stroke();<br />
ctx.restore();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christophe VG</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3456</link>
		<dc:creator>Christophe VG</dc:creator>
		<pubDate>Wed, 01 Apr 2009 12:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3456</guid>
		<description>Hi Ben, 

I came across you post looking for &quot;crisp canvas lines&quot;. You describe the problem I&#039;m facing, but  zooming appears not to be the cause of my problem.

If you like, please take a look at the following example:


  
    
    
      var ctx = document.getElementById(&quot;canvas&quot;).getContext(&quot;2d&quot;);
      ctx.save();
      // not crisp
      ctx.moveTo(33,10);
      ctx.lineTo(33,90);
      ctx.stroke();
      // crisp
      ctx.fillRect(66,10,1,80);
      ctx.restore();
    
  


When I use the &quot;default&quot; way of drawing lines, I get the impression that two anti-aliased(?)/semi-transparent lines are drawn right next to each other, resulting in a 2px dark-grey line, where I would expect to be able to draw a crisp 1px black line.

It almost looks like your first example and I would expect it to look like your expected example. The only way I can draw these crisp lines, is by using the fillRect method to fill a rect of width 1.

Do you know if this behaviour is &quot;by design&quot; ? How do you go about drawing these crisp lines ?

Thanks a lot in advance.</description>
		<content:encoded><![CDATA[<p>Hi Ben, </p>
<p>I came across you post looking for &#8220;crisp canvas lines&#8221;. You describe the problem I&#8217;m facing, but  zooming appears not to be the cause of my problem.</p>
<p>If you like, please take a look at the following example:</p>
<p>      var ctx = document.getElementById(&#8220;canvas&#8221;).getContext(&#8220;2d&#8221;);<br />
      ctx.save();<br />
      // not crisp<br />
      ctx.moveTo(33,10);<br />
      ctx.lineTo(33,90);<br />
      ctx.stroke();<br />
      // crisp<br />
      ctx.fillRect(66,10,1,80);<br />
      ctx.restore();</p>
<p>When I use the &#8220;default&#8221; way of drawing lines, I get the impression that two anti-aliased(?)/semi-transparent lines are drawn right next to each other, resulting in a 2px dark-grey line, where I would expect to be able to draw a crisp 1px black line.</p>
<p>It almost looks like your first example and I would expect it to look like your expected example. The only way I can draw these crisp lines, is by using the fillRect method to fill a rect of width 1.</p>
<p>Do you know if this behaviour is &#8220;by design&#8221; ? How do you go about drawing these crisp lines ?</p>
<p>Thanks a lot in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Galbraith</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3161</link>
		<dc:creator>Ben Galbraith</dc:creator>
		<pubDate>Wed, 07 Jan 2009 15:16:41 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3161</guid>
		<description>The project targets any canvas-equipped browser, but I don&#039;t want to spoil the surprise--I&#039;ll talk more about it next week. :-)</description>
		<content:encoded><![CDATA[<p>The project targets any canvas-equipped browser, but I don&#8217;t want to spoil the surprise&#8211;I&#8217;ll talk more about it next week. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: enefekt</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3160</link>
		<dc:creator>enefekt</dc:creator>
		<pubDate>Wed, 07 Jan 2009 13:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3160</guid>
		<description>Thanks for the tip. 

If you don&#039;t mind me asking, what&#039;s the project?
And what proportion of it is in canvas as opposed to HTML?
Heck, while I&#039;m at it, what browsers are you targeting for it? :)</description>
		<content:encoded><![CDATA[<p>Thanks for the tip. </p>
<p>If you don&#8217;t mind me asking, what&#8217;s the project?<br />
And what proportion of it is in canvas as opposed to HTML?<br />
Heck, while I&#8217;m at it, what browsers are you targeting for it? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajaxian &#187; Watch out for the zoom; Debugging fun with Canvas</title>
		<link>http://benzilla.galbraiths.org/2009/01/06/html-5-canvas-lessons-zooming-and-reusing/#comment-3159</link>
		<dc:creator>Ajaxian &#187; Watch out for the zoom; Debugging fun with Canvas</dc:creator>
		<pubDate>Wed, 07 Jan 2009 13:49:46 +0000</pubDate>
		<guid isPermaLink="false">http://benzilla.galbraiths.org/?p=333#comment-3159</guid>
		<description>[...] The debugging exersize was fun, and he shares it with you on his personal blog. [...]</description>
		<content:encoded><![CDATA[<p>[...] The debugging exersize was fun, and he shares it with you on his personal blog. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
