Flint Particle System Forum - Bitmapdata for threshold Tue, 13 Dec 2011 01:56:32 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Bitmapdata for threshold http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1591#Comment_1591 http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1591#Comment_1591 Wed, 23 Mar 2011 19:45:36 +0000 AAD
I'm trying to create a fluid effect by blurring particles and then using threshold on the blurred data. My question is what data I should be using. I want to have my compare image be a black background ( I think I got it) but what would the bitmapdata be from the particles be? I tried to use the bitmaprenderer but that wasn't right. below is the relevant (I think) part of the code:

var renderer:BitmapRenderer = new BitmapRenderer(new Rectangle( 0, 0, 800, 600 ));
renderer.addFilter( new BlurFilter( 20, 20, 5 ) );
renderer.addEmitter( emitter );
var bmd1:BitmapData = new BitmapData(400, 400, true, 0xFFCCCCCC);
var pt:Point = new Point(0, 0);
renderer.threshold(bmd1, bmd1.rect, pt, ">", 0XFF2b2b2b, 0x55FFFFFF, 0xFFFFFFFF, false);

Basically, for the last line instead of renderer.threshold what should it be? ]]>
Bitmapdata for threshold http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1593#Comment_1593 http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1593#Comment_1593 Sun, 27 Mar 2011 23:40:35 +0100 AAD

1061: Call to a possibly undefined method threshold through a reference with static type Class.

Clearly the renderer isn't the bitmapdata, but I'm not sure how (or if) Flint exports the data (specifically bitmap data, as I am using the BitmapRenderer).

Thanks in advance. ]]>
Bitmapdata for threshold http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1595#Comment_1595 http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1595#Comment_1595 Sun, 03 Apr 2011 20:31:02 +0100 Richard bitmapData property. That's the bitmap data of the renderer. ]]> Bitmapdata for threshold http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1596#Comment_1596 http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1596#Comment_1596 Mon, 04 Apr 2011 00:07:09 +0100 AAD
var renderer:BitmapRenderer = new BitmapRenderer(new Rectangle( 0, 0, 800, 600 ));
renderer.addFilter( new BlurFilter( 20, 20, 5 ) );
renderer.addEmitter( emitter );

var point:Point=new Point(0,0);

var bd:BitmapRenderer;
bd.bitmapData();

var bd2:BitmapData;
bd2.fillRect(rect, 0x00000000);

bd2.threshold(bd, rect, point, ">", 155/255*0xffffff, 0x8C8C8C8C, 0x00ffffff, false);

The error I'm getting (2 of them):

For the line bd.bitmapData();
1195: Attempted access of inaccessible method bitmapData through a reference with static type org.flintparticles.twoD.renderers:BitmapRenderer.


and for the threshold line:
1067: Implicit coercion of a value of type org.flintparticles.twoD.renderers:BitmapRenderer to an unrelated type flash.display:BitmapData.

Am I not accessing the data properly?
Again, thanks. ]]>
Bitmapdata for threshold http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1607#Comment_1607 http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1607#Comment_1607 Wed, 20 Apr 2011 08:04:01 +0100 Richard
First, you need to instantiate the bd variable. At the moment it's null.

Then to access its bitmapData property, use bd.bitmapData - no parenthesis.

So in the threshold line, use bd.bitmapData, not bd. ]]>