<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Steven Engelhardt &#187; Silverlight</title>
	<atom:link href="http://www.deez.info/sengelha/category/programming/csharp/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deez.info/sengelha</link>
	<description>A financial industry software developer's thoughts and insights</description>
	<lastBuildDate>Tue, 13 Apr 2010 18:28:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Silverlight 1.0 Mandelbrot Set Generator</title>
		<link>http://www.deez.info/sengelha/2008/01/09/silverlight-10-mandelbrot-set-generator/</link>
		<comments>http://www.deez.info/sengelha/2008/01/09/silverlight-10-mandelbrot-set-generator/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 05:40:19 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.deez.info/sengelha/2008/01/09/silverlight-10-mandelbrot-set-generator/</guid>
		<description><![CDATA[While reading the Mandelbrot set chapter in Dewdney&#8217;s The New Turing Omnibus, I realized that this would be a great test application for Microsoft&#8217;s new interactive Web application framework Silverlight.  Below is the component, its source code, and a few things I learned along the way.
Beware: the Mandelbrot set is computationally expensive and may [...]]]></description>
			<content:encoded><![CDATA[<p>While reading the Mandelbrot set chapter in Dewdney&#8217;s <a href="http://books.google.com/books?id=XW7fICYtkg8C&#038;dq=new+turing+omnibus&#038;pg=PP1&#038;ots=fWQUbonyHG&#038;sig=vJQ_A0J7V0DQMsnf2AH2LoLyMFc&#038;hl=en&#038;prev=http://www.google.com/search?hl=en&#038;q=new+turing+omnibus&#038;sa=X&#038;oi=print&#038;ct=title&#038;cad=one-book-with-thumbnail">The New Turing Omnibus</a>, I realized that this would be a great test application for Microsoft&#8217;s new interactive Web application framework <a href="http://silverlight.net/">Silverlight</a>.  Below is the component, its source code, and a few things I learned along the way.</p>
<p>Beware: the Mandelbrot set is computationally expensive and may appear to lock up your web browser.  If a &#8220;Stop running this script?&#8221; dialog pops up, please click no to allow the calculations to finish.<br />
<span id="more-5439"></span></p>
<h3>Silverlight 1.0 Mandelbrot Set Control</h3>
<p>Here is a Silverlight 1.0 control which draws the Mandelbrot set.  Left-click to zoom in on a particular region.<br />
<script type="text/javascript" src="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/js/Silverlight/Silverlight.js"></script><br />
<script type="text/javascript" src="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/js/SilverlightMandelbrot.js"></script><br />
<script type="text/javascript" src="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/js/SilverlightMandelbrotEvents.js"></script></p>
<div style="width:300px; height:300px;" id="SilverlightMandelbrot"></div>
<p><script type="text/javascript">  var parentElement = document.getElementById("SilverlightMandelbrot");  createSilverlightMandelbrot("/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/xaml/mandelbrot.xaml");</script></p>
<h3>Source Code</h3>
<p>The source code to the Silverlight Mandelbrot set consists of the following pieces:</p>
<ul>
<li><a href="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/js/SilverlightMandelbrot.js">SilverlightMandelbrot.js</a> &mdash; The code for instantiating the Silverlight Mandelbrot control and binding it to a <code>div</code></li>
<li><a href="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/js/SilverlightMandelbrotEvents.js">SilverlightMandelbrotEvents.js</a> &mdash; The event handlers for the Silverlight Mandelbrot control, including the drawing code itself (performed on canvas load)</li>
<li><a href="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/xaml/mandelbrot.xaml">mandelbrot.xaml</a> &mdash; The XAML which defines the visual layout of the control</li>
<li><a href="/sengelha/wp-content/uploads/2008/01/SilverlightMandelbrot/js/Silverlight/Silverlight.js">Silverlight.js</a> &mdash; the Silverlight code itself</li>
</ul>
<h3>Notable Findings</h3>
<ul>
<li>Overall responsiveness is rather slow, especially on the mousemove event.  Perhaps I&#8217;m pushing Silverlight too hard too early, but this slowness makes me highly reluctant to adopt Silverlight yet.</li>
<li>I can&#8217;t figure out how to do progressive (e.g. line-by-line) rendering to give the user feedback.</li>
<li>There is no facility for directly painting an individual pixel within Silverlight.  Instead, you must draw 1 by 1 colored XAML rectangle controls.  Because individual XAML rectangles are quite heavyweight, I coalesce multiple pixels of the same color in the same row into one rectangle.</li>
<li>I wanted to use right-click to zoom out, but there doesn&#8217;t appear to be a way to capture the right click event from within Silverlight.</li>
</ul>
<h3>About the Mandelbrot Set</h3>
<p>For more information on the Mandelbrot set, see <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">its Wikipedia article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deez.info/sengelha/2008/01/09/silverlight-10-mandelbrot-set-generator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
