<?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>Dreaming in Flash &#187; Bitmap</title>
	<atom:link href="http://www.dreaminginflash.com/category/bitmap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dreaminginflash.com</link>
	<description>There is no universally agreed-upon biological definition of dreaming</description>
	<lastBuildDate>Mon, 12 Jul 2010 15:22:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Taking a snapshot of an flv</title>
		<link>http://www.dreaminginflash.com/2007/12/03/taking-a-snapshot-of-an-flv/</link>
		<comments>http://www.dreaminginflash.com/2007/12/03/taking-a-snapshot-of-an-flv/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 17:48:39 +0000</pubDate>
		<dc:creator>Idoru</dc:creator>
				<category><![CDATA[Actionscript3]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WorkAround]]></category>

		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/12/03/taking-a-snapshot-of-an-flv/</guid>
		<description><![CDATA[Following my last post on 9-Slice items, here comes another nice one on Bitmap.draw() and the security sandbox.
Many people know the solution to this one, but i just found myself looking for it for too long, so here it goes  
If you want to take a snapshot of a running Video object, you can't, [...]]]></description>
			<content:encoded><![CDATA[<p>Following my last post on 9-Slice items, here comes another nice one on Bitmap.draw() and the security sandbox.<br />
Many people know the solution to this one, but i just found myself looking for it for too long, so here it goes <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you want to take a snapshot of a running Video object, you can't, you'll be alerted by the flash player that you are violating<br />
the sandbox security. So how do we do it?<br />
Easy as pie <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<code><br />
video.attachNetStream( null );<br />
bitmapData.draw( video );<br />
video.attachNetStream ( myNetStreamObject );<br />
</code></p>
<p>Three very simple lines of code but that are hard to come by.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.dreaminginflash.com/2007/12/03/taking-a-snapshot-of-an-flv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>9-Slice and Bitmap</title>
		<link>http://www.dreaminginflash.com/2007/12/03/9-slice-and-bitmap/</link>
		<comments>http://www.dreaminginflash.com/2007/12/03/9-slice-and-bitmap/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 17:41:54 +0000</pubDate>
		<dc:creator>Idoru</dc:creator>
				<category><![CDATA[Actionscript3]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[Papervision3d]]></category>
		<category><![CDATA[WorkAround]]></category>

		<guid isPermaLink="false">http://www.dreaminginflash.com/2007/12/03/9-slice-and-bitmap/</guid>
		<description><![CDATA[Have you ever tried to take a snapshot using bitmap.draw() of a movieclip that has 9-slice enabled?

//my9SliceEnabledMc is a 40 by 40 9-slice enabled movieclip on stage
my9SliceEnabledMc.width = 200;
my9SliceEnabledMc.height = 300;
var myBitmapData = new BitmapData(200,300);
myBitmapData.draw(my9SliceEnabledMc);
addChild(new Bitmap(myBitmapData));

So what you'd expect to happen above is to have a new bitmap that looks the same as my9SliceEnabledMc,
but what [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to take a snapshot using bitmap.draw() of a movieclip that has 9-slice enabled?<br />
<code><br />
//my9SliceEnabledMc is a 40 by 40 9-slice enabled movieclip on stage<br />
my9SliceEnabledMc.width = 200;<br />
my9SliceEnabledMc.height = 300;<br />
var myBitmapData = new BitmapData(200,300);<br />
myBitmapData.draw(my9SliceEnabledMc);<br />
addChild(new Bitmap(myBitmapData));<br />
</code></p>
<p>So what you'd expect to happen above is to have a new bitmap that looks the same as my9SliceEnabledMc,<br />
but what you get instead is the original 40x40 movieclip.<br />
This doesn't make sense at all, i have no idea what Adobe was thinking when they let this one through.<br />
This was driving me crazy for a while now, and today i finally found the answer, as simple as it seems,<br />
putting the my9SliceEnabledMc inside another sprite corrects the issue!!<br />
<code><br />
//my9SliceEnabledMc is a 40 by 40 9-slice enabled movieclip on the library<br />
var myContainer = new Sprite();<br />
var my9SliceEnabledMc = new my9SliceEnabledMc();<br />
myContainer.addChild(my9SliceEnabledMc);<br />
my9SliceEnabledMc.width = 200;<br />
my9SliceEnabledMc.height = 300;<br />
var myBitmapData = new BitmapData(200,300);<br />
myBitmapData.draw(myContainer);<br />
addChild(new Bitmap(myBitmapData))<br />
</code></p>
<p>Also i should add that this is a major issue with PV3D since you cannot directly use a 9-slice item as a texture.</p>

]]></content:encoded>
			<wfw:commentRss>http://www.dreaminginflash.com/2007/12/03/9-slice-and-bitmap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
