<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>kynd.info/dev/</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/" />
    <link rel="self" type="application/atom+xml" href="http://www.kynd.info/dev/atom.xml" />
    <id>tag:www.kynd.info,2008-11-30:/dev//4</id>
    <updated>2009-12-27T08:24:41Z</updated>
    <subtitle>Notes and experiments on development with flash, ajax, processing, and whatever!</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.22-ja</generator>

<entry>
    <title>New blog</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/12/new-blog.html" />
    <id>tag:www.kynd.info,2009:/dev//4.135</id>

    <published>2009-12-27T05:31:47Z</published>
    <updated>2009-12-27T08:24:41Z</updated>

    <summary>I finally made up my mind to abandon old hat Movable Type and switch to Wordpress.MT was not necessarily bad. It is superior to WP in some point, but as it gets apparently slower when republishing the site, I&apos;ve been felt like trying a new system. So far, I&apos;m very satisfied with the swiftness and well designed interface.I mean to tinker with it for a while.kynd.info/dev/ is no more updated. Visit new blog at www.kynd.info/log/...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[I <font style="" onmouseover="emph_wt(this," finally="" )="">finally</font> <font onmouseover="emph_wt(this," made="" )="">made</font> <font onmouseover="emph_wt(this," up="" )="">up</font> <font onmouseover="emph_wt(this," my="" )="">my</font> <font onmouseover="emph_wt(this," mind="" )="">mind</font> <font onmouseover="emph_wt(this," to="" )="">to</font> <font onmouseover="emph_wt(this," abandon="" )="">abandon</font> <font onmouseover="emph_wt(this," old="" )="">old</font> <font onmouseover="emph_wt(this," hat="" )="">hat</font> <font onmouseover="emph_wt(this," movable="" )="">Movable</font> <font onmouseover="emph_wt(this," type="" )="">Type</font> <font onmouseover="emph_wt(this," and="" )="">and</font> <font onmouseover="emph_wt(this," switch="" )="">switch</font> <font onmouseover="emph_wt(this," to="" )="">to</font> <font style="" onmouseover="emph_wt(this," wordpress="" )="">Wordpress</font>.<br /><font onmouseover="emph_wt(this," mt="" )="">MT</font> <font onmouseover="emph_wt(this," was="" )="">was</font> <font onmouseover="emph_wt(this," not="" )="">not</font> <font onmouseover="emph_wt(this," necessarily="" )="">necessarily</font> <font onmouseover="emph_wt(this," bad="" )="">bad</font>. <font onmouseover="emph_wt(this," it="" )="">It</font> <font onmouseover="emph_wt(this," is="" )="">is</font> <font onmouseover="emph_wt(this," superior="" )="">superior</font> <font onmouseover="emph_wt(this," to="" )="">to</font> <font onmouseover="emph_wt(this," wp="" )="">WP</font> <font onmouseover="emph_wt(this," in="" )="">in</font> <font onmouseover="emph_wt(this," some="" )="">some</font> <font onmouseover="emph_wt(this," point="" )="">point</font>, <font onmouseover="emph_wt(this," but="" )="">but</font> <font onmouseover="emph_wt(this," as="" )="">as</font> <font onmouseover="emph_wt(this," it="" )="">it</font> <font style="" onmouseover="emph_wt(this," gets="" )="">gets</font> <font style="" onmouseover="emph_wt(this," apparently="" )="">apparently</font> <font onmouseover="emph_wt(this," slower="" )="">slower</font> <font onmouseover="emph_wt(this," when="" )="">when</font> <font onmouseover="emph_wt(this," republishing="" )="">republishing</font> <font onmouseover="emph_wt(this," the="" )="">the</font> <font onmouseover="emph_wt(this," site="" )="">site</font>, I'<font onmouseover="emph_wt(this," ve="" )="">ve</font> <font onmouseover="emph_wt(this," been="" )="">been</font> <font onmouseover="emph_wt(this," felt="" )="">felt</font> <font onmouseover="emph_wt(this," like="" )="">like</font> <font onmouseover="emph_wt(this," trying="" )="">trying</font> a <font onmouseover="emph_wt(this," new="" )="">new</font> <font style="" onmouseover="emph_wt(this," system="" )="">system</font>. <br /><font style="" onmouseover="emph_wt(this," so="" )="">So</font> <font style="" onmouseover="emph_wt(this," far="" )="">far</font>, I'm <font style="" onmouseover="emph_wt(this," very="" )="">very</font> <font onmouseover="emph_wt(this," satisfied="" )="">satisfied</font> <font onmouseover="emph_wt(this," with="" )="">with</font> <font onmouseover="emph_wt(this," the="" )="">the</font> <font onmouseover="emph_wt(this," swiftness="" )="">swiftness</font> <font onmouseover="emph_wt(this," and="" )="">and</font> <font onmouseover="emph_wt(this," well="" )="">well</font> <font onmouseover="emph_wt(this," designed="" )="">designed</font> <font onmouseover="emph_wt(this," interface="" )="">interface</font>.<br />I <font onmouseover="emph_wt(this," mean="" )="">mean</font> <font onmouseover="emph_wt(this," to="" )="">to</font> <font style="" onmouseover="emph_wt(this," tinker="" )="">tinker</font> <font style="" onmouseover="emph_wt(this," with="" )="">with</font> <font onmouseover="emph_wt(this," it="" )="">it</font> <font style="" onmouseover="emph_wt(this," for="" )="">for</font> a <font onmouseover="emph_wt(this," while="" )="">while</font>.<br /><br /><font onmouseover="emph_wt(this," kynd="" )="">kynd</font>.info/dev/ <font onmouseover="emph_wt(this," is="" )="">is</font> <font onmouseover="emph_wt(this," no="" )="">no</font> <font style="" onmouseover="emph_wt(this," more="" )="">more</font> <font onmouseover="emph_wt(this," updated="" )="">updated</font>. <font onmouseover="emph_wt(this," visit="" )="">Visit</font> <font style="" onmouseover="emph_wt(this," new="" )="">new</font> <font style="" onmouseover="emph_wt(this," blog="" )="">blog</font> <font onmouseover="emph_wt(this," at="" )="">at</font> <a href="http://www.kynd.info/log/"><font style="" onmouseover="emph_wt(this," www="" )="">www</font>.kynd.info/log/</a> ]]>
        
    </content>
</entry>

<entry>
    <title>(Blender) collision</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/11/blender-collision.html" />
    <id>tag:www.kynd.info,2009:/dev//4.134</id>

    <published>2009-11-26T00:06:59Z</published>
    <updated>2009-11-26T00:12:32Z</updated>

    <summary>also based on a tutorial from Bounce, Tumble, and Splash!: Simulating the Physical World with Blender 3D. collision from kynd on Vimeo....</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Blender" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="3d" label="3d" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blender" label="Blender" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[also based on a tutorial from <a href="http://www.amazon.com/Bounce-Tumble-Splash-Simulating-Physical/dp/0470192801/ref=sr_1_5?ie=UTF8&amp;s=books&amp;qid=1259078655&amp;sr=1-5">Bounce, Tumble, and Splash!: Simulating the Physical World with Blender 3D</a>.<br /><br /><br /> <object height="300" width="400"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7825688&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7825688&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="300" width="400"></object><p><a href="http://vimeo.com/7825688">collision</a> from <a href="http://vimeo.com/user1203681">kynd</a> on <a href="http://vimeo.com/">Vimeo</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>(Blender) Phisics tutorials</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/11/blender-spring-tutorial.html" />
    <id>tag:www.kynd.info,2009:/dev//4.133</id>

    <published>2009-11-24T16:04:57Z</published>
    <updated>2009-11-26T00:06:43Z</updated>

    <summary>from Bounce, Tumble, and Splash!: Simulating the Physical World with Blender 3D.spring Spring from kynd on Vimeo. fluid fluid from kynd on Vimeo....</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Blender" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="3d" label="3D" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blender" label="Blender" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[from <a href="http://www.amazon.com/Bounce-Tumble-Splash-Simulating-Physical/dp/0470192801/ref=sr_1_5?ie=UTF8&amp;s=books&amp;qid=1259078655&amp;sr=1-5">Bounce, Tumble, and Splash!: Simulating the Physical World with Blender 3D</a>.<br /><br /><br /><h3 class="sub">spring</h3>
<object height="300" width="400"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7797516&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7797516&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="300" width="400"></object><p><a href="http://vimeo.com/7797516">Spring</a> from <a href="http://vimeo.com/user1203681">kynd</a> on <a href="http://vimeo.com/">Vimeo</a>.</p>
<h3 class="sub">fluid</h3>
<object height="300" width="400"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=7798345&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=7798345&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" height="300" width="400"></object><p><a href="http://vimeo.com/7798345">fluid</a> from <a href="http://vimeo.com/user1203681">kynd</a> on <a href="http://vimeo.com/">Vimeo</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>(Blender) Blender study</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/11/blender-blender-study.html" />
    <id>tag:www.kynd.info,2009:/dev//4.132</id>

    <published>2009-11-24T11:15:22Z</published>
    <updated>2009-11-26T00:08:40Z</updated>

    <summary>Driven by the necessity to prepare some realistic materials for a project, I&apos;ve been studying Blender, an open source 3D suite, for about half a day. To confess, this is the first time for me to really use 3D software. I&apos;m still having troubles in making textures come out the way I want......</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Blender" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="3d" label="3d" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blender" label="Blender" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[Driven by the necessity to prepare some realistic materials for a project, I've been studying <a href="http://www.blender.org/">Blender</a>, an open source 3D suite, for about half a day. To confess, this is the first time for me to really use 3D software. I'm still having troubles in making textures come out the way I want...<br /><br /> <a href="http://www.flickr.com/photos/kynd/4130072497/" title="mountain by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2771/4130072497_509d341ea7.jpg" alt="mountain" height="375" width="500" /></a><br /><br />
<a href="http://www.flickr.com/photos/kynd/4129949197/" title="stones by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2526/4129949197_35790056e5.jpg" alt="stones" height="375" width="500" /></a>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) Automated marker sketching</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-automated-marker-sketching.html" />
    <id>tag:www.kynd.info,2009:/dev//4.131</id>

    <published>2009-10-26T15:55:58Z</published>
    <updated>2009-10-27T13:02:11Z</updated>

    <summary>I am testing a new algorithm for the automated painter that yields images which look like sketches with marker pens....</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="as3" label="AS3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="painting" label="painting" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[<span class="mod_span">I am testing a new algorithm for the automated painter that yields images which look like sketches with marker pens.</span><br /><br /><a href="http://www.flickr.com/photos/kynd/4047077394/" title="20091027005231 by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2750/4047077394_67a5569eb4.jpg" alt="20091027005231" width="500" height="375" /></a>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) Hubble Project</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-hubble-project.html" />
    <id>tag:www.kynd.info,2009:/dev//4.130</id>

    <published>2009-10-18T05:48:07Z</published>
    <updated>2009-10-20T13:04:48Z</updated>

    <summary>Quiet nights &apos;n quiet stars, quiet chords from my guitar. I needed more than a hundred images of universe for a certain project. Buying them from a stock photo service costs too much, and taking the photos by myself didn&apos;t sound realistic. So I decided to have Flash fabricate them.After a few tries at coding and an hour nap while the program was running, I got more than two hundred pictures of universe that seemed nice. I&apos;ve uploaded some records...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[Quiet nights 'n quiet stars, quiet chords from my guitar. I needed more than a hundred images of universe for a certain project. Buying them from a stock photo service costs too much, and taking the photos by myself didn't sound realistic. So I decided to have Flash fabricate them.<br />After a few tries at coding and an hour nap while the program was running, I got more than two hundred pictures of universe that seemed nice. <br />I've uploaded some records of my struggle to Flickr. <br /><br /><a href="http://www.flickr.com/photos/kynd/sets/72157622445679449/">Hubble Project on Flickr</a><br /><br />

<a href="http://www.flickr.com/photos/kynd/4021595222/" title="Hubble20091018140816 by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2615/4021595222_866f38720c.jpg" alt="Hubble20091018140816" width="500" height="375" /></a>
<br /><br />
<a href="http://www.flickr.com/photos/kynd/4012173836/" title="Hubble20091015031335 by kynd, on Flickr"><img src="http://farm4.static.flickr.com/3131/4012173836_8cc4c873a1.jpg" alt="Hubble20091015031335" width="500" height="375" /></a>
<br /><br />
<a href="http://www.flickr.com/photos/kynd/4008084927/" title="Hubble20091014004622 by kynd, on Flickr"><img src="http://farm4.static.flickr.com/3525/4008084927_964a98c41e.jpg" alt="Hubble20091014004622" width="500" height="375" /></a>
<br /><br />]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) Color range selection</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-color-range-selection.html" />
    <id>tag:www.kynd.info,2009:/dev//4.129</id>

    <published>2009-10-17T21:18:21Z</published>
    <updated>2009-10-18T06:11:58Z</updated>

    <summary>It must be very useful of a function equivalent to &apos;Color Range&apos; selection in Photoshop can be realized with Flash. First, I thought about majoring the distance of the color of each pixel to the sample color using the Pythagorean theorem, but I abandoned it because the workload　to doing it pixel by pixel must be too heavy. Instead of that, I made it with Bitmap.threshold method.　This may be rather rough way of doing it, but the result is satisfactory and...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[<p>It must be very useful of a function equivalent to 'Color Range' selection in Photoshop can be realized with Flash.</p>
<p>First, I thought about majoring the distance of the color of each pixel to the sample color using the Pythagorean theorem, but I abandoned it because the workload　to doing it pixel by pixel must be too heavy.</p>
<p>Instead of that, I made it with Bitmap.threshold method.　This may be rather rough way of doing it, but the result is satisfactory and fast.</p>

<script language="JavaScript" type="text/javascript" src="/dev/flash/js/flashembed.js"></script>
<script language="JavaScript" type="text/javascript">
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
		'width', '300',
		'height', '300',
		'src', '/dev/flash/ColorRange',
		'quality', 'high',
		'pluginspage', 'http://www.adobe.com/go/getflashplayer_jp',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'ColorRange',
		'bgcolor', '#ffffff',
		'name', 'ColorRange',
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', '/dev/flash/ColorRange',
		'salign', ''
		); //end AC code
</script>
<br /><br /><code class="codebox">package {<br />&nbsp;&nbsp; &nbsp;import flash.display.*;<br />&nbsp;&nbsp; &nbsp;import flash.events.*;<br />&nbsp;&nbsp; &nbsp;import flash.geom.*;<br />&nbsp;&nbsp; &nbsp;public class BmpColorRange extends Sprite {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; var src:BitmapData;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; var canvas:BitmapData;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; public function BmpColorRange(s:BitmapData) {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; src = s;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; canvas = new BitmapData(s.width, s.height, true, 0x00000000);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; addChild(new Bitmap(canvas));<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; public function select(col:uint):void {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var tmp:BitmapData = new BitmapData(src.width, src.height, true, col | 0xff000000);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var r:uint, g:uint, b:uint, rmin:uint, gmin:uint, bmin:uint, rmax:uint, gmax:uint, bmax:uint;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var min:uint, max:uint;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var range:uint = 30;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; r = col &gt;&gt; 16 &amp; 0xfff;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; g = col &gt;&gt; 8 &amp; 0xff;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; b = col &amp; 0xff;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rmax = Math.max(0, r - range);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gmax = Math.max(0, g - range);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bmax = Math.max(0, b - range);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; rmin = Math.min(255, r + range);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; gmin = Math.min(255, g + range);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bmin = Math.min(255, b + range);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; min = rmin &lt;&lt; 16 | gmin &lt;&lt; 8 | bmin;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; max = rmax &lt;&lt; 16 | gmax &lt;&lt; 8 | bmax;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.draw(src);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.threshold(tmp, new Rectangle(0, 0, tmp.width, tmp.height), new Point(0,0), "&gt;=", min, 0xff000000, 0x00ff0000, true);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.threshold(tmp, new Rectangle(0, 0, tmp.width, tmp.height), new Point(0,0), "&gt;=", min, 0xff000000, 0x0000ff00, true);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.threshold(tmp, new Rectangle(0, 0, tmp.width, tmp.height), new Point(0,0), "&gt;=", min, 0xff000000, 0x000000ff, true);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.threshold(tmp, new Rectangle(0, 0, tmp.width, tmp.height), new Point(0,0), "&lt;=", max, 0xff000000, 0x00ff0000, true);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.threshold(tmp, new Rectangle(0, 0, tmp.width, tmp.height), new Point(0,0), "&lt;=", max, 0xff000000, 0x0000ff00, true);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; tmp.threshold(tmp, new Rectangle(0, 0, tmp.width, tmp.height), new Point(0,0), "&lt;=", max, 0xff000000, 0x000000ff, true);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; canvas.draw(tmp);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp; &nbsp;}<br />}</code>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) drawTriangles</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-drawtriangles.html" />
    <id>tag:www.kynd.info,2009:/dev//4.128</id>

    <published>2009-10-17T21:02:35Z</published>
    <updated>2009-10-17T21:05:06Z</updated>

    <summary>UVT mapping with Graphic.drawTriangle method sample movie and scripts...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Math &amp; Physics" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="3d" label="3D" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="math" label="math" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[<p>UVT mapping with Graphic.drawTriangle method</p>

<a href="http://www.kynd.info/library/mathandphysics/drawTriangels_01">sample movie and scripts<br />
<img src="http://www.kynd.info/library/mathandphysics/img/drawTriangels_01.png" /></a>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) Automated water-color painter 2</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-automated-water-color-painter-2.html" />
    <id>tag:www.kynd.info,2009:/dev//4.127</id>

    <published>2009-10-12T17:16:54Z</published>
    <updated>2009-10-13T15:57:36Z</updated>

    <summary>Here are some of the latest works by the automated water-color painter. I&apos;ve been trying to make it flexible so that parameters like the size of brush stroke, depth of color and so on can be tweaked with slider bars and the results can be directly saved to the hard-drive. As a result it&apos;s got to be the most prolific version among the auto-painters I&apos;ve ever made so far, though it&apos;s still a patchy tool which is only comprehensible to...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="as3" label="AS3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="painting" label="painting" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[Here are some of the latest works by the <a href="http://www.kynd.info/dev/2009/09/flash-automated-water-color-painter.html">automated water-color painter</a>. I've been trying to make it flexible so that parameters like the size of brush stroke, depth of color and so on can be tweaked with slider bars and the results can be directly saved to the hard-drive. As a result it's got to be the most prolific version among the auto-painters I've ever made so far, though it's still a patchy tool which is only comprehensible to me. It's kind of fun to see it creating different styles of works that I didn't anticipate beforehand. <br />More works are also available in the photo stream <a href="http://www.flickr.com/photos/kynd/sets/72157620075762996/">"auto paintings" on Flickr.</a><br /><br /> 
<a href="http://www.flickr.com/photos/kynd/4004047664/" title="20091012120338 by kynd, on Flickr"><img src="http://farm4.static.flickr.com/3449/4004047664_11fe34116a.jpg" alt="20091012120338" height="375" width="500" /></a><br /><br />
<a href="http://www.flickr.com/photos/kynd/4003376737/" title="20091012144243 by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2535/4003376737_219d4e8154.jpg" alt="20091012144243" height="375" width="500" /></a><br /><br />

<a href="http://www.flickr.com/photos/kynd/4002927321/" title="20091012111006 by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2502/4002927321_ae5de7d957.jpg" alt="20091012111006" height="375" width="500" /></a><br /><br />

<a href="http://www.flickr.com/photos/kynd/4002932401/" title="20091012113504 by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2453/4002932401_7912b7b9a9.jpg" alt="20091012113504" height="375" width="500" /></a><br /><br />]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) How to save an image file to the user&apos;s local drive</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-how-to-save-a-image-file-to-the-users-local.html" />
    <id>tag:www.kynd.info,2009:/dev//4.126</id>

    <published>2009-10-09T13:32:55Z</published>
    <updated>2009-10-10T01:16:02Z</updated>

    <summary><![CDATA[ AC_FL_RunContent( 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0', 'width', '300', 'height', '300', 'src', '/dev/flash/filesave', 'quality', 'high', 'pluginspage', 'http://www.adobe.com/go/getflashplayer_jp', 'align', 'middle', 'play', 'true', 'loop', 'true', 'scale', 'showall', 'wmode', 'window', 'devicefont', 'false', 'id', 'filesave', 'bgcolor', '#ffffff', 'name', 'filesave', 'menu', 'true', 'allowFullScreen', 'false', 'allowScriptAccess','sameDomain', 'movie', '/dev/flash/filesave', 'salign', '' ); //end AC code Sample code package {&nbsp;&nbsp; &nbsp;import flash.display.*;&nbsp;&nbsp; &nbsp;import flash.events.*;&nbsp;&nbsp; &nbsp;import flash.net.*;&nbsp;&nbsp; &nbsp;import flash.utils.ByteArray;&nbsp;&nbsp; &nbsp;import com.adobe.images.PNGEncoder;&nbsp;&nbsp; &nbsp;public class ImageSaver extends Sprite {&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;private var fileReference:FileReference;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function ImageSaver() {&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;save_btn.addEventListener(MouseEvent.CLICK, h_saveClick);&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}&nbsp;&nbsp;...]]></summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[<script language="JavaScript" type="text/javascript" src="/dev/flash/js/flashembed.js"></script>
<script language="JavaScript" type="text/javascript">
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
		'width', '300',
		'height', '300',
		'src', '/dev/flash/filesave',
		'quality', 'high',
		'pluginspage', 'http://www.adobe.com/go/getflashplayer_jp',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'filesave',
		'bgcolor', '#ffffff',
		'name', 'filesave',
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', '/dev/flash/filesave',
		'salign', ''
		); //end AC code
</script>
<br /><br />




<h3 class="sub">Sample code</h3>
<code class="codebox">
package {<br />&nbsp;&nbsp; &nbsp;import flash.display.*;<br />&nbsp;&nbsp; &nbsp;import flash.events.*;<br />&nbsp;&nbsp; &nbsp;import flash.net.*;<br />&nbsp;&nbsp; &nbsp;import flash.utils.ByteArray;<br />&nbsp;&nbsp; &nbsp;import com.adobe.images.PNGEncoder;<br /><br />&nbsp;&nbsp; &nbsp;public class ImageSaver extends Sprite {<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;private var fileReference:FileReference;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function ImageSaver() {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;save_btn.addEventListener(MouseEvent.CLICK, h_saveClick);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function h_saveClick(evt:MouseEvent):void {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var b:BitmapData = new BitmapData(100, 100, false, 0xff0000);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;save(b);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function save(b:BitmapData):void {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var pngBytes:ByteArray= PNGEncoder.encode(b);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fileReference=new FileReference();<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fileReference.save(pngBytes,"sample.png");<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} catch (e:Error) {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;trace(e);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;}<br />} 
</code><br /><br />
<h3 class="sub">AIR version with File and FileStream object</h3>
<code class="codebox">
package {<br />&nbsp;&nbsp; &nbsp;import flash.display.*;<br />&nbsp;&nbsp; &nbsp;import flash.events.*;<br />&nbsp;&nbsp; &nbsp;import flash.filesystem.*;<br />&nbsp;&nbsp; &nbsp;import flash.utils.ByteArray;<br />&nbsp;&nbsp; &nbsp;import com.adobe.images.PNGEncoder;<br /><br />&nbsp;&nbsp; &nbsp;public class ImageSaver extends Sprite {<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;private var file:File;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;private var bmpd:BitmapData;<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function ImageSaver() {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;save_btn.addEventListener(MouseEvent.CLICK, h_saveClick);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function h_saveClick(evt:MouseEvent):void {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var b:BitmapData=new BitmapData(100,100,false,0xff0000);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;save(b);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;public function save(b:BitmapData):void {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;bmpd=b;<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;file=new File(File.desktopDirectory.url+"/sample.png");<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;file.addEventListener(Event.SELECT,h_select);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;file.browseForSave("save");<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;private function h_select(evt:Event):void {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;try {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var pngBytes:ByteArray=PNGEncoder.encode(bmpd);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;var stream:FileStream = new FileStream( );<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;stream.open(file, FileMode.WRITE);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;stream.writeBytes(pngBytes, 0, pngBytes.length);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;stream.close( );<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} catch (e:Error) {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;trace(e);<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br />&nbsp;&nbsp; &nbsp;}<br />}</code>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) How to load and display the user&apos;s local image</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-how-to-load-and-display-the-users-local-image.html" />
    <id>tag:www.kynd.info,2009:/dev//4.125</id>

    <published>2009-10-08T16:49:00Z</published>
    <updated>2009-10-10T01:11:10Z</updated>

    <summary>This sample simply opens the file selection dialogue box and loads the selected image to the blank canvas on the screen. There&apos;s nothing worth showing - it simply serves as a reminder to myself of how to do it. AC_FL_RunContent( &apos;codebase&apos;, &apos;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0&apos;, &apos;width&apos;, &apos;300&apos;, &apos;height&apos;, &apos;300&apos;, &apos;src&apos;, &apos;/dev/flash/fileload&apos;, &apos;quality&apos;, &apos;high&apos;, &apos;pluginspage&apos;, &apos;http://www.adobe.com/go/getflashplayer_jp&apos;, &apos;align&apos;, &apos;middle&apos;, &apos;play&apos;, &apos;true&apos;, &apos;loop&apos;, &apos;true&apos;, &apos;scale&apos;, &apos;showall&apos;, &apos;wmode&apos;, &apos;window&apos;, &apos;devicefont&apos;, &apos;false&apos;, &apos;id&apos;, &apos;fileload&apos;, &apos;bgcolor&apos;, &apos;#ffffff&apos;, &apos;name&apos;, &apos;fileload&apos;, &apos;menu&apos;, &apos;true&apos;, &apos;allowFullScreen&apos;, &apos;false&apos;, &apos;allowScriptAccess&apos;,&apos;sameDomain&apos;, &apos;movie&apos;, &apos;/dev/flash/fileload&apos;, &apos;salign&apos;, &apos;&apos; );...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[This sample simply opens the file selection dialogue box and loads the selected image to the blank canvas on the screen. There's nothing worth showing - it simply serves as a reminder to myself of how to do it.
<br /><br />
<script language="JavaScript" type="text/javascript" src="/dev/flash/js/flashembed.js"></script>
<script language="JavaScript" type="text/javascript">
	AC_FL_RunContent(
		'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
		'width', '300',
		'height', '300',
		'src', '/dev/flash/fileload',
		'quality', 'high',
		'pluginspage', 'http://www.adobe.com/go/getflashplayer_jp',
		'align', 'middle',
		'play', 'true',
		'loop', 'true',
		'scale', 'showall',
		'wmode', 'window',
		'devicefont', 'false',
		'id', 'fileload',
		'bgcolor', '#ffffff',
		'name', 'fileload',
		'menu', 'true',
		'allowFullScreen', 'false',
		'allowScriptAccess','sameDomain',
		'movie', '/dev/flash/fileload',
		'salign', ''
		); //end AC code
</script>
<br /><br />




<h3 class="sub">Sample code</h3>
<code class="codebox">
package {<br />&nbsp;&nbsp;&nbsp; import flash.display.*;<br />&nbsp;&nbsp;&nbsp; import flash.events.*;<br />&nbsp;&nbsp;&nbsp; import flash.net.*;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; public class ImageLoader extends Sprite {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private var fileReference:FileReference;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function ImageLoader() {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; open_btn.addEventListener(MouseEvent.CLICK, h_openClick);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function&nbsp; h_openClick(evt:MouseEvent):void {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fileReference = new FileReference();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fileReference.addEventListener(Event.SELECT, selectHandler);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fileReference.addEventListener(Event.COMPLETE, completeHandler);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var fileFilter:FileFilter = new FileFilter("Images","*.jpg;*.jpeg;*.gif;*.png");<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fileReference.browse([fileFilter]);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private function selectHandler(event:Event):void {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fileReference.load();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private function completeHandler(event:Event):void {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var loader:Loader = new Loader();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; loader.loadBytes(fileReference.data);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; addChild(loader);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}<br />
</code><br /><br />
<h3 class="sub">AIR version with File and FileStream object</h3>
<code class="codebox">
package {<br />&nbsp;&nbsp;&nbsp; import flash.display.*;<br />&nbsp;&nbsp;&nbsp; import flash.events.*;<br />&nbsp;&nbsp;&nbsp; import flash.filesystem.*;<br />&nbsp;&nbsp;&nbsp; import flash.net.*;<br />&nbsp;&nbsp;&nbsp; import flash.utils.ByteArray;<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; public class ImageLoader extends Sprite {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private var file:File;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private var loader:Loader;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function ImageLoader() {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; open_btn.addEventListener(MouseEvent.CLICK, h_openClick);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function&nbsp; h_openClick(evt:MouseEvent):void {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; file = new File(File.desktopDirectory.url);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; file.addEventListener(Event.SELECT, selectHandler);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var fileFilter:FileFilter = new FileFilter("Images","*.jpg;*.jpeg;*.gif;*.png");<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; file.browseForOpen("open imagefile",[fileFilter]);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private function selectHandler(event:Event):void {<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var stream:FileStream = new FileStream( );<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var bytes:ByteArray = new ByteArray();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; stream.open(file, FileMode.READ);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; stream.readBytes(bytes);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; loader = new Loader();<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; loader.loadBytes(bytes);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; addChild(loader);<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; loader.y = 36;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; stream.close( );<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }</code>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) ExternalInterface sample</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-externalinterface-sample.html" />
    <id>tag:www.kynd.info,2009:/dev//4.124</id>

    <published>2009-10-06T15:35:48Z</published>
    <updated>2009-10-10T01:09:53Z</updated>

    <summary>As I always forget how to implement ExternalInterface, I&apos;ve uploaded a sample application.The sample is like a chat application between flash and html in which short messages can be sent from one to another and vice versa. see sample applicationsource codes can be downloaded here...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="javascript" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[As I always forget how to implement ExternalInterface, I've uploaded a sample application.<br />The sample is like a chat application between flash and html in which short messages can be sent from one to another and vice versa. <br /><br /><a href="http://www.kynd.info/library/externalInterface/">see sample application</a><br /><a href="http://www.kynd.info/library/externalInterface/externalInterface.zip">source codes can be downloaded here</a><br />]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) Color Palette Creator</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/10/flash-color-palette-creator.html" />
    <id>tag:www.kynd.info,2009:/dev//4.123</id>

    <published>2009-10-04T17:08:36Z</published>
    <updated>2009-10-05T14:38:49Z</updated>

    <summary>Color Palette Creator is an application that &apos;summarizes&apos; the colors used in the uploaded image and represents the results in bar charts. I wrote this to prepare for next version of automatic painting experiment, but this can also be used to other purposes, for example, in making a color theme for the interface of a mobile phone or web application from the user&apos;s favorite photo.The application analyzes the colors using two different color spaces: RGB and HSV, and generates two...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[Color Palette Creator is an application that 'summarizes' the colors used in the uploaded image and represents the results in bar charts. I wrote this <span class="mod_span"><span class="f_red">to prepare</span> </span> for next version of automatic painting experiment, but this can also be used to other purposes, for example, in making a color theme for the interface of a mobile phone or web application from the user's favorite photo.<br />The application analyzes the colors using two different color spaces: RGB and HSV, and generates two graphs. RGB seems to work better most of the time, but I left both for comparison. Try uploading your images.<br /><br /><br />
<a href="http://www.kynd.info/library/colorPalette/">Color Palette Creator</a>
<br /><br />
<img src="http://www.kynd.info/library/colorPalette/samples/screen01.jpg" /><br /><br /><br />
<img src="http://www.kynd.info/library/colorPalette/samples/screen02.jpg" />]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) RGB and HSV - Math and (Quasi) physics in AS3</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/09/flash-rgb-and-hsv---math-and-quasi-physics-in-as3.html" />
    <id>tag:www.kynd.info,2009:/dev//4.122</id>

    <published>2009-09-22T13:01:47Z</published>
    <updated>2009-09-23T04:22:21Z</updated>

    <summary>The RGB color model is commonly used in computers as a direct representation of additive color mixing which most display devices utilize, while HSV is a model to describe perceptual color relationships in more intuitive manner. RGB stands for red, green and blue, and HSV stands for hue, saturation and value RGB values can be converted to HSV values and vice versa using the formulas below: RGB to HSV r, g, b ∈ [0,1] max = max(r, g, b), min...</summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Math &amp; Physics" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="as3" label="AS3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="colormodel" label="color model" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="math" label="math" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[<p>The RGB color model is commonly used in computers as a direct representation of additive color mixing which most display devices utilize, while 
HSV is a model to describe perceptual color relationships in more intuitive manner. RGB stands for red, green and blue, and HSV stands for hue, saturation and value</p>
<p>RGB values can be converted to HSV values and vice versa using the formulas below:</p>
<h3 class="sub">RGB to HSV</h3>
<p><code></code></p><pre>r, g, b ∈ [0,1]
max = max(r, g, b), min = min(r, g, b)

h =
0 | if max = min
(60 * (g - b) / (max - min) + 360) % 360 | if max = r
60 * (b - r) / (max - min) + 120 | if max = g
60 * (r - g) / (max - min) + 240 | if max = b

s =
0 | if max = 0
(max - min) / max | otherwise

v = max
</pre>
<h3 class="sub">HSV to RGB</h3>
<p><code></code></p><pre>h ∈ [0,360], s, v ∈ [0,1]

hi = floor(_h / 60) % 6
f = _h / 60 - floor(_h / 60)
p = v * (1 - s)
q = v * (1 - f * s)
t = v * (1 - (1 - f) * s)
			
(r,g, b) =
(v, t, p) | if hi = 0
(q, v, p) | if hi = 1
(p, v, t) | if hi = 2
(p, q, v) | if hi = 3
(t, p, v) | if hi = 4
(v, p, q) | if hi = 5
</pre>
<p>See <a href="http://en.wikipedia.org/wiki/RGB_color_model">'RGB color model - Wikipedia'</a> and <a href="http://en.wikipedia.org/wiki/HSL_and_HSV">'HSL and HSV - Wikipedia'</a> for more about RGB and HSV models.
</p>

<a href="http://www.kynd.info/library/mathandphysics/RGB_HSV_01">sample movie and scripts<br />
<img src="http://www.kynd.info/library/mathandphysics/img/RGB_HSV_01.png" /></a>]]>
        
    </content>
</entry>

<entry>
    <title>(Flash) Automated water-color painter</title>
    <link rel="alternate" type="text/html" href="http://www.kynd.info/dev/2009/09/flash-automated-water-color-painter.html" />
    <id>tag:www.kynd.info,2009:/dev//4.121</id>

    <published>2009-09-17T16:11:30Z</published>
    <updated>2009-09-19T01:31:58Z</updated>

    <summary><![CDATA[Autumn is said to be the time to do something artistic, at least here in my country, and so I'm back in automated painting projects again after a few months' interval.Apart from the last version that creates oil-paint-like texture, I mean to build a water-color painter this time. I've just worked on it for a few tens of&nbsp; minutes and fabricated strokes that look somewhat like water paint. But the result is yet crude. I think it's mainly due to...]]></summary>
    <author>
        <name>kynd-info</name>
        
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="painting" label="painting" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="watercolor" label="water-color" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.kynd.info/dev/">
        <![CDATA[Autumn is said to be the time to do something artistic, at least here in my country, and so I'm back in automated painting projects again after a few months' interval.<br /><br />Apart from the last version that creates oil-paint-like texture, I mean to build a water-color painter this time. I've just worked on it for a few tens of&nbsp; minutes and fabricated strokes that look somewhat like water paint. But the result is yet crude. I think it's mainly due to the brushwork. In contrast to oil-paintings that are usually made by accumulating many layers of colors, water-color paintings should be done with fewer fine touches. The next challenge will be to create longer strokes that follow the shape of the motif, which will require more ingenious image analysis.&nbsp; 
<br /><br />
<a href="http://www.flickr.com/photos/kynd/3929221600/" title="forest by kynd, on Flickr"><img src="http://farm3.static.flickr.com/2541/3929221600_730b05b2a1.jpg" alt="forest" width="500" height="375" /></a>]]>
        
    </content>
</entry>

</feed>
