<?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/"
		>
<channel>
	<title>Comments on: Capturing Signature on the Pocket PC</title>
	<atom:link href="http://www.wengkien.com/2007/10/06/capturing-signature-on-the-pocket-pc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wengkien.com/2007/10/06/capturing-signature-on-the-pocket-pc/</link>
	<description>...Viva La Vida...</description>
	<lastBuildDate>Tue, 18 Oct 2011 13:19:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: szehau</title>
		<link>http://www.wengkien.com/2007/10/06/capturing-signature-on-the-pocket-pc/comment-page-1/#comment-2</link>
		<dc:creator>szehau</dc:creator>
		<pubDate>Fri, 12 Oct 2007 16:03:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.wengkien.com/2007/10/06/capturing-signature-on-the-pocket-pc/#comment-2</guid>
		<description>I would suggest some optimization over your code

- Constructor
Create a fix size array, say &quot;bool pix[MAX_WIDTH*MAX_HEIGHT];&quot;, that represent the state of all the pixels on the screen.

- OnMouseMove
Set the state of that (x,y) pixel, say &quot;pix[x+y*MAX_WIDTH] = true;&quot;
Refresh screen (Invalidate)

- To export the signature map to visible string
foreach pix[xi+yi*MAX_WIDTH] that is true, append to string as value of (xi+yi*MAX_WIDTH) and also separate with any separator (e.g. &quot;,)

- To import visible string and convert into signature map
Reset the pix array (set all element to false). Read string and throw away the separators, convert the value into integer. Set &quot;pix[value] = true&quot;. Make sure validate the value to avoid buffer over/underflow

- Draw the signature
foreach pix[xi+yi*MAX_WIDTH] that is true, set the screen pixel to a color. if you want the signature looks &quot;bold&quot;er, u can draw a circle with larger radius around the pixel.</description>
		<content:encoded><![CDATA[<p>I would suggest some optimization over your code</p>
<p>- Constructor<br />
Create a fix size array, say &#8220;bool pix[MAX_WIDTH*MAX_HEIGHT];&#8221;, that represent the state of all the pixels on the screen.</p>
<p>- OnMouseMove<br />
Set the state of that (x,y) pixel, say &#8220;pix[x+y*MAX_WIDTH] = true;&#8221;<br />
Refresh screen (Invalidate)</p>
<p>- To export the signature map to visible string<br />
foreach pix[xi+yi*MAX_WIDTH] that is true, append to string as value of (xi+yi*MAX_WIDTH) and also separate with any separator (e.g. &#8220;,)</p>
<p>- To import visible string and convert into signature map<br />
Reset the pix array (set all element to false). Read string and throw away the separators, convert the value into integer. Set &#8220;pix[value] = true&#8221;. Make sure validate the value to avoid buffer over/underflow</p>
<p>- Draw the signature<br />
foreach pix[xi+yi*MAX_WIDTH] that is true, set the screen pixel to a color. if you want the signature looks &#8220;bold&#8221;er, u can draw a circle with larger radius around the pixel.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

