Flint Particle System Forum - Bitmapdata for threshold 2011-12-13T01:39:22+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Bitmapdata for threshold http://flintparticles.org/forum/comments.php?DiscussionID=469&Focus=1591#Comment_1591 2011-03-23T19:45:36+00:00 2011-12-13T01:39:22+00:00 AAD http://flintparticles.org/forum/account.php?u=482 I've been toying with Flash as3 and FLINT - I'm not a coder by any standard but I've been patching bits and pieces of what I find to make some things work. I'm trying to create a fluid effect by ...
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 2011-03-27T23:40:35+01:00 2011-12-13T01:39:22+00:00 AAD http://flintparticles.org/forum/account.php?u=482 When I try it I get the error: 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 ...

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 2011-04-03T20:31:02+01:00 2011-04-03T20:31:26+01:00 Richard http://flintparticles.org/forum/account.php?u=1 The BitmapRenderer has a bitmapData property. That's the bitmap data of the renderer. 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 2011-04-04T00:07:09+01:00 2011-12-13T01:39:22+00:00 AAD http://flintparticles.org/forum/account.php?u=482 Ah ok. Thank you. Still having a bit of trouble though. What I have thus far: var renderer:BitmapRenderer = new BitmapRenderer(new Rectangle( 0, 0, 800, 600 )); renderer.addFilter( new ...
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 2011-04-20T08:04:01+01:00 2011-12-13T01:39:22+00:00 Richard http://flintparticles.org/forum/account.php?u=1 bitmapData is a property, and you're calling it like it's a method. First, you need to instantiate the bd variable. At the moment it's null. Then to access its bitmapData property, use ...
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.]]>