Possible With Bitmap Data?
Hi,
Is it possible to load an image into a BitmapData object and then use mcs as "cookie cutters" to copy the image below them (So if the mc is a circle, you would sample a circular section of the image) and use this copy to generate a movieclip of the copy?
Don't need to know the details, just if possible and a hint as to how.
Many thanks.
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 02-01-2007, 03:43 PM
View Complete Forum Thread with Replies
Sponsored Links:
Bitmap Data
hello;
I have realized that I have never seen bitmap data before; I suspect that bitmap data is a list of name/value pairs such as:
pixel(xx,yy) => rgb(rrr,ggg,bbb);
I would think that it should be possible to view the bitmap data in a text editor;
any thoughts?
dsdsdsdsd
Asheville NC USA
View Replies !
View Related
Bitmap Data
I'm using Flash 8, with this code in the first frame:
import flash.display.BitmapData;
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;
var plaid:BitmapData.loadBitmap("plaid");
function fillBG(){
this.beginBitmapFill("plaid");
this.moveTo(0,0);
this.lineTo(Stage.width,0);
this.lineTo(Stage.width,Stage.height);
this.lineTo(0,Stage.height);
this.lineTo(0,0);
this.endFill(0,0);
}
var StageL:Object=new Object();
StageL.onResize= function(){
fillBG();
rissa._x=Stage.width/2;
rissa._y=Stage.height/2;
}
Stage.addListener(StageL);
When I publish the file, I'm getting the following error message in the Output panel:
**Error** Scene=Scene 1, layer=Layer 2, frame=1:Line 7: The class or interface 'BitmapData.loadBitmap' could not be loaded.
var plaid:BitmapData.loadBitmap("plaid");
Total ActionScript Errors: 1 Reported Errors: 1
Any answers to why this error message is appearing? Any assistance is immensely appreciated....
View Replies !
View Related
[F8] Compressing Bitmap Data
Hi,
Has anyone ever had experience with 'compressing' bitmapData using Matrices (or any other methods)? I've read that its possible by using 'Base 32', but I have no idea how to actually carry it out and can't find any information on it.
Basically I have an image that I convert to bitmapData and then send to a php script for processing...but its quite slow due to all of the data being send to the file (it sends one 'row' worth of bitmapData from the image to php at a time)...and want some way of compressing all of that data to send it to php quicker (and reduce bandwidth).
Any ideas? or know of any resources that could help me out?
Thanks!
-b.
View Replies !
View Related
Alpha Bitmap Data
Ok I have a movieclip that I am importing to my class...then inside the class I get a bitmapData object to .draw() the movieclip. Now I am splitting this movie clip into chunks into an array. How do I keep the alpha data associated to the movie clip?
View Replies !
View Related
BitMap Data Not Showing
Hi,
this seems to be a bug in Flash, when attaching bitmap data to a movie clip, it displays locally, but once I put the swf on a server, the bitmap doesn't diplsay at all... any ideas? Here is my code:
Code:
var myBitmap = new BitmapData(50, 50, true, 0x00FFFFFF);
//mc is a movie clip containing an image
myBitmap.draw(mc);
var clone = _root.createEmptyMovieClip("clone",1);
clone.attachBitmap(myBitmap,1, "auto", true);
Thanks,
Joseph
View Replies !
View Related
Bitmap Data... Weird
Hi there.
I hope someone will be able to answer me.
Could you check this swf or fla (those are sample to show you what's weird)
What happen so.
I'm drawing on a MC (line) a black line, 5px thick, using lineTo(0, 100);
I'm copying this image on the BitmapData object (myBMP.draw(line));
I'm clearing the MC (line).
I'm redrawing on the MC (line) a white line, 5px thick, using lineTo(0, 100);
I'm copying this image on the BitmapData object (myBMP.draw(line));
I'm clearing the MC (line).
the result?
I can still see the black line underneath. I mean just the border of it... How come ?
If you're zooming and clicking several time on the draw second line you will see something more weird... Anyway for me...
Any help appreciated
C ya mates
View Replies !
View Related
Trouble With Bitmap Data
Hello,
I am loading external images and then would like to make bitmap data objects from then. Below is the code I am using.
It works fine is I make a bitmap data of something already on the stage, but not the images that I am loading in.
Any ideas?
Code:
for (i=0; i<1; i++){
//attach new item
content_mc.attachMovie("introduction", "page"+i, itemDepth);
content_mc["page"+i].title_txt.htmlText = page.childNodes[3].childNodes[1].firstChild.nodeValue;
// builds page
howManyRolls = introAssets.childNodes.length;
for(j=0; j<=howManyRolls; j++){
tmc = content_mc["page"+i]["image"+j+"_mc"].imageHolder_mc;
//trace(tmc);
oListener.onLoadStart = function(mc:MovieClip){
this["bitmap"+j] = new BitmapData(300, 500, true);
this["bitmap"+j].draw(content_mc["page"+i]["image"+j+"_mc"].imageHolder_mc);
_root.attachBitmap(this["bitmap"+j], _root.getNextHighestDepth(), "auto", true);
}
oListener.onLoadProgress = function(imageLoader, nLoaded, nTotal){
//trace(imageLoader+" loaded "+nLoaded+" of "+nTotal+" bytes");
}
oListener.onLoadComplete = function(){
}
imageLoader.addListener(oListener);
imageLoader.loadClip(introAssets.childNodes[j-1].childNodes[0].firstChild.nodeValue, content_mc["page"+i]["image"+j+"_mc"].imageHolder_mc.imageInside_mc);
}
}
View Replies !
View Related
Bitmap Data Question
I want to take screen capture of the stage. And convert it to a bitmap image.
I can do it with a movie clip as follows
var jpgSource:BitmapData = new BitmapData (p.width, p.height);
jpgSource.draw(p);
var jimo = new MovieClip();
var bmp:Bitmap = new Bitmap(jpgSource);
jimo.addChild(bmp);
addChild(jimo);
but I want all the display objects on the stage????
Any advice
Jim
View Replies !
View Related
Bitmap Data + Drawing API?
I'm trying to do a Flash paint app that uses some fairly complex glows and blurs. Naturally as you continue to draw, the framerate starts to drop because redraw region increases.
So what I want to do is have the user draw, and when they release the mouse button, it uses bitmap data to capture what they've drawn with the glows and everything already applied. It then clears out the movie clip with all the vector lines they've drawn, but they can continue to paint. Releasing the mouse button again just recaptures the canvas as bitmap data with the new shapes.
The problem I'm having is that instead of adding the new stuff they've drawn to the old bitmap, it just replaces the bitmap entirely. It just seems to be overwriting the old bitmap. I was under the impression that you could, in a sense, take a snapshot of the new shapes on top of the old bitmap and create a new bitmap with everything. I can't get this to occur.
Does anyone have any suggestions on how I should approach this? And did what I write even make any sense?
View Replies !
View Related
Problem With Bitmap Data
Ok so I'm having problems with the bitmap data class. I am creating a marquee of images and duplicating them using the draw method. This works fine locally, but when uploaded it does nothing. I figure it has something to do with the fact the I have all my media on a separate server, but I thought I had all the security settings right to have it work. I have the domain allowed in the security settings. I have the cross domain policy file in place on the media server and loaded. Any ideas? Right now I have it jury rigged using the load clip method, but if someone leaves their browser on the page the flash with just eat bandwidth.
View Replies !
View Related
Problem With Bitmap Data
Arrggggg can anyone help with this one.
I am loading in images which all works finein authormode in flash. However when i place it on our lan it doesnt seem to render the images at all. replacing them jsut with white. I am using bitmapdata which seems to be where the problem is, as if i just laod the images direct it works fine. Has anyone experienced something similar?
regards
ade
View Replies !
View Related
Bitmap Data Blues
Hello,
I'm hoping someone can help me with the following dilema I'm having...
I'm trying to work with:
"import flash.display.BitmapData;
import flash.geom.Rectangle;
import flash.geom.Point;"
I want to have an image where the pixels, (maybe 10px x 10 px) fly in or maybe fall in to recreate the original bimap image, captured by the BitmapData function. I know the image can be taken apart by pixes, but am having trouble "controlling" them to do what I'm trying to achieve. Has anyone had success with this??
Here's an example of what I mean by the pixels being broken apart and coming together again. Sorry in advace that it is a poor example.
www.redfield.us/bitmapdata_effect.swf
Thanks!
Suz
View Replies !
View Related
For Those Experienced With Bitmap Data
How do you change the coordinates of a bitmap data object? IE, not the holder that is displaying the BMD, but the BMD itself.
I have an example here, 3 bitmap data objects, with their holders lined up next to each other on the stage, now I want to be able to draw on each one individually, with the same drawing MC. However, the drawing MC simply draws on all 3 simultaneously.
What can I do on this test to get all 3 bitmap datas to draw when the mouse is over them, BUT, with the same drawing MC, not 3 seperate ones.
Cheers,
Joe
View Replies !
View Related
Working With Bitmap Data In As2
i created a gallery using bitmap Data. on my computer every thing works fine
when i upload it on the server it doesnt work properly on IE7 and 6 and on FF it works ok after i reload it a few times.....
what i have is a dynamic thumbnail strip which i load with an XML file. into a movieclip named thumbs in order to put a mask on it .
when i press one of the buttons the flash goes to that frame where i activate the next function:
Code:
var yLoc = 0;
var currentCatMain = 0;
loderFun = function (currentCat) {
currentCatMain = currentCat;
for (i=0; i<this["path_thNmame"+currentCat].length; i++) {
this.createEmptyMovieClip("holder_mc"+i, this.getNextHighestDepth());
this["loader"+i] = new MovieClipLoader();
this["loader"+i].addListener(this);
this["loader"+i].loadClip(this["path_thNmame"+currentCat][i], this["holder_mc"+i]);
}
};
//this function is called by the 'loader' object when the file is loaded and ready to use
function onLoadInit(i) {
m = i._name;
m = m.slice(9, 10);
this["myBitmap"+m] = new BitmapData(this["holder_mc"+m]._width, this["holder_mc"+m]._height, true, 0x00FFFFFF);
this["myBitmap"+m].draw(this["holder_mc"+m]);
this["holder_mc"+m].removeMovieClip();
this.thumbs.createEmptyMovieClip("targetClip"+m, this.getNextHighestDepth());
this.thumbs["targetClip"+m].attachBitmap(this["myBitmap"+m], 1);
this.thumbs["targetClip"+m]._xscale = 100;
this.thumbs["targetClip"+m]._yscale = 100;
this.thumbs["targetClip"+m]._x = 0;
this.thumbs["targetClip"+m]._y = yLoc;
spaceAndWidth = this.thumbs["targetClip"+m]._height+4;
yLoc += spaceAndWidth;
}
//this function is called by the 'loader' object if the file couldn't be loadd
function onLoadError() {
/*
The external file failed to load so we don't need
the holding movieclip anymore
*/
holder_mc.removeMovieClip();
}
what happens with the server is that i see each picture for a second and then it dissapears....
i have no idea why? here is the link
View Replies !
View Related
Placing Bitmap Data
My question is this:
Since you cannot use the smooth command on dynamically loaded JPG or any pictures. I have use the bitmapData class to redraw this jpg and use the smoothing option in that class.
Everything to this point works fine.
I am resizing the background to fit the fullscreen stage width and height with some kind of tween.
Again everything works to this point.
This is what im trying to accomplish:
I want the picture that is making the background to resize form the center of the stage and not the default (0,0) coordinates.
I have to reposition the bitmap.draw movieClip to the center of the holder and than resize that holder or so I thought...so far no luck.
I have try using the geom.rectangle class to adjust it again no luck...
any of you have any ideas?
I cannot pos any codes snippet due to company policies but maybe some of you have run into a similar problem
Thanks.
View Replies !
View Related
Bitmap Data Class
G'day People
I seem to be here every 10 minutes.
I am getting this error:-
The class or interface 'flash.display.BitmapData' could not be loaded.
var myBitmapData:BitmapData = new BitmapData(540, 400, false);
I am calling - import flash.display.BitmapData
Can someone explain what is happening.
thanks easy
View Replies !
View Related
[F8] Bitmap Data - Darker Than Png File ?
Hi Flashkit section Actionscript.
I have a strange issue with BitmapDatas.
I load external sheets which are stored in .png files and I want to remove their background color using Bitmap.treshold. The background color is 0x(FF)666666
The problem is that my threshold myFaceBMP.threshold(myFaceBMP, new Rectangle(0, 0, 32, 32), new Point(0, 0), "==", 0xFF666666, 0x00000000, 0xFFFFFFFF, true); wont work.
However, I found out the reason why by taking a screenshot of my running swf. For some reason, the 0x666666 is not displayed as 0x666666 but 0x656565 and that's why it wont disappear. If I set the parameter in threshold to 0x656565, it disappears (but the file contains 0x666666 !).
Has anyone encountered such a situation before ? Is there anyway to render the colors as they should be ?
Thanks for reading ^^
View Replies !
View Related
Bitmap Data Particle Effects
Hi, I was looking at Keith Peters' blog and found a really neat little thing...
http://www.bit-101.com/blog/?p=1152 (there is a link below the picture to see the swf)
Anyways, I set out to try and make a similar effect on my own. It was all working very nicely until I brought my test value of 30 particles up to 500.
His has 1000 and is not at all lagging behind whichever framerate he used. Mine was severly bogged down with 500.
Upon closer inspection of the particles, I found that they were still being drawn as vectors, rather than single pixels. I have set cacheAsBitmap = true for each, and still it doesnt work.
Can anyone point me in the right direction?
Any help would be greatly appreciated,
Mavrisa
View Replies !
View Related
Converting A Movieclip To Bitmap Data
Hi,
Just been gradually switching over to AS3, and I've hit a problem and its doing my nut in because I can't find a way to get it to work.
Basically I want to take a portion of a movieclip and convert it into bitmap data into another movieclip.
I know the basis would be something like:
var b:BitmapData=new BitmapData(100,100,false);
var bm:Bitmap=new Bitmap(b);
mymc.addChild(bm);
But I can't work out how to get that to pick up the movieclip that I'm trying to extract from.
Hayyyulp.
The link below is the kind of method I want, but because this is drawn at real time it would cause the area to expand with the movie clip, when all i want is to extract a portion and place it as a surface texture. (draw on the box on the right hand side)
http://www.visitmyworld.co.uk/body.swf
Also, I don't really think it necessary to update in realtime, that and id assume generating the bitmap area in real time would cause major slowdown issues. If anybody has any different solutions to what I propose then advice welcome.
The reason id want a bitmap is that data id want to project could be complex layers, ie- items can be dragged on rather than just being drawn on.
Cheers,
Adam
View Replies !
View Related
Bitmap Data Draws White Box
Any ideas why this is drawing a white box behind my Bitmap object? How do i rid myself of that pesky white box, I want my Bitmap Object to have some transparency
ActionScript Code:
private function _createSnapshot(img:*) : Bitmap {
var mode:String = BlendMode.NORMAL;
var snap:BitmapData = new BitmapData(img.width, img.height);
snap.draw (img, new Matrix, new ColorTransform, mode);
var newBitmap:Bitmap = new Bitmap(snap);
return newBitmap;
}
View Replies !
View Related
Single Frame Of Bitmap Data
so I am developing this thing that is meant to store a single frame of a movieclip when it is called using bitmap data even though the clip keeps playing, the only problem is that even know im only calling the fill and such once, the bitmap I filled continues to update on every frame, below is a snippet of the code I am using, what it does is creates a display holder and some bitmap data that I then use to draw out another movieclip (videoHolder)
Code:
vidDisplayHolder = new MovieClip;
_mom._mom.addChild(vidDisplayHolder);
bmp = new BitmapData(640,360);
bmp.draw(_mom._mom.videoHolder);
vidDisplayHolder.graphics.clear();
vidDisplayHolder.graphics.beginBitmapFill(bmp);
vidDisplayHolder.graphics.drawRect(0,0,640,360);
vidDisplayHolder.graphics.endFill();
so i guess my question is, does anyone know of a way to tell the BitmapData object to only grab a single frame and not update again once it has been called?
thx
View Replies !
View Related
Save Bitmap Data To Server
Is there a way to save bitmap image data to a server from a running swf in Flash CS4? In other words is there a way to export the image data, movieclip, Sprite or whatever to the server or even on the users computer?
View Replies !
View Related
Converting A Movieclip To Bitmap Data (AS3)
Hi,
Just been gradually switching over to AS3, and I've hit a problem and its doing my nut in because I can't find a way to get it to work.
Basically I want to take a portion of a movieclip and convert it into bitmap data into another movieclip.
I know the basis would be something like:
var b:BitmapData=new BitmapData(100,100,false);
var bm:Bitmap=new Bitmap(b);
mymc.addChild(bm);
But I can't work out how to get that to pick up the movieclip that I'm trying to extract from.
Hayyyulp.
The link below is the kind of method I want, but because this is drawn at real time it would cause the area to expand with the movie clip, when all i want is to extract a portion and place it as a surface texture. (draw on the box on the right hand side)
http://www.visitmyworld.co.uk/body.swf
Also, I don't really think it necessary to update in realtime, that and id assume generating the bitmap area in real time would cause major slowdown issues. If anybody has any different solutions to what I propose then advice welcome.
The reason id want a bitmap is that data id want to project could be complex layers, ie- items can be dragged on rather than just being drawn on.
Cheers,
Adam
View Replies !
View Related
Bitmap Data Vs Memory Usage
Simple question
Usign cacheAsBitmap is usedfull in many case. I just wondering if the memory usage used when a clip is set to true will be free when the clip will be removed from the timeline.
I want to used cacheAsBitMap for some clip, but don't want to load all the computer memory when the user come on my website.
Tanx for you help
View Replies !
View Related
Bitmap Data Vs Memory Usage
Simple question
Usign cacheAsBitmap is usedfull in many case. I just wondering if the memory usage used when a clip is set to true will be free when the clip will be removed from the timeline.
I want to used cacheAsBitMap for some clip, but don't want to load all the computer memory when the user come on my website.
Tanx for you help
View Replies !
View Related
Bouncing Bitmap Data, Efficiency
I was curious as to how well the BitmapData object performed, I'm impressed with this one.
This is a good example of how to create visual objects that are not vector, yet are easily manipulated by a class.
We will keep creating balls that constantly are moving and bouncing around the screen. The efficiency comes in part that these balls are represented only as data, we are actually looping through all of the balls, and asking for their information then placing it on the screen manually.
BouncyBall.as
ActionScript Code:
import flash.display.BitmapData;import flash.geom.Rectangle;class BouncyBall{ private static var BOUNCE:Number = -1; private var graphic:Rectangle; // the bitmap data that represents this object private var x:Number; private var y:Number; private var radius:Number = 2; private var vx:Number; private var vy:Number; private var limits:Rectangle; private var animationIntervalID:Number; /** * Constructor * * @param The starting X position of this ball. * @param The starting Y position of this ball. * @param The starting speed of this ball on the x axis. * @param The starting speed of this ball on the y axis. * @param A rectangle object that represents the limits that this ball is bound to * @param The movieclip that the ball will be drawn into. */ public function BouncyBall( radius:Number, startX:Number, startY:Number, startSpeedX:Number, startSpeedY:Number, limits:Rectangle ) { this.radius = radius; this.x = startX; this.y = startY; this.vx = startSpeedX; this.vy = startSpeedY; this.limits = limits; graphic = new Rectangle( x, y, radius, radius); //this.target.attachBitmap( graphic, 100 ); beginMoving(); } /** * Returns the bitmap data that represents this ball */ public function get bitmap() : Rectangle { graphic.x = x; graphic.y = y; return graphic.clone(); } /** * Moves the ball */ private function beginMoving() : Void { animationIntervalID = setInterval(this, "move", 40); } private function move() : Void { this.x += vx; this.y += vy; if (x + radius > limits.right || x < limits.left) { vx *= BouncyBall.BOUNCE; } if (y + radius > limits.bottom || y < limits.top) { vy *= BouncyBall.BOUNCE; } } }
The code that is in the .fla
ActionScript Code:
import flash.display.BitmapData;import flash.geom.Rectangle;var balls:Array = new Array();var dupID = setInterval(this, "newBall", 10);var game = new BitmapData(550, 400, true, 0xFFFFFFFF);var cleanUP = new BitmapData(550, 400, true, 0xFFFFFFFF);test.setPixel( Stage.width/2, Stage.height/2, 0xFF0000 );attachBitmap( game, 100 );function newBall(){ balls.push(new BouncyBall(3, 20, 20, 5, 5, new Rectangle(0, 0, 550, 400), this));}function onEnterFrame(){ game.draw( cleanUP ); for (var i:Number=0; i<balls.length; i++) { game.fillRect( balls[i].bitmap, Math.random() * 0xFFFFFFFF ); }}
I let this run for over a half an hour with absolutely no loss in speed.
Take Care.
_Michael
View Replies !
View Related
Using Bitmap Data Smooth In My Gallery
hi i want to use bitmap data smooth when loading my images
here is the function that loads the images , how can i implement bitmap data smooth to this?
Code:
function handleThumbRelease():Void {
var which:String = this._parent._name;
var num:Number = Number(which.substr(6));
thumbSelected = num;
if (!mainTL.large_mc) {
mainTL.attachMovie("large.box", "bgroundBox_mc", mainTL.getNextHighestDepth(), {_alpha:0, _x:Stage.width/2, _y:Stage.height/2, _width:Stage.width, _height:Stage.height});
mainTL.attachMovie("mc.large_image", "large_mc", mainTL.getNextHighestDepth(), {_visible:false, _x:Stage.width/2, _y:Stage.height/2});
mainTL.bgroundBox_mc.colorTo(0x000000, 0);
mainTL.bgroundBox_mc.alphaTo(80, 1, 'easeInOutSine');
mcl2.loadClip(dirPath + gallery_obj.imagePath + "/" + library_obj.image[num].path, mainTL.large_mc.holder);
enableThumbs(false);
enableButtons(false);
enableMainNav(false);
// mark as viewed
this.viewed = true;
this.alphaTo(35, 1, 'easeInOutSine');
this._parent.highlight.alphaTo(0, 1, 'easeOutExpo');
}
};
thanks
View Replies !
View Related
Converting A Movieclip To Bitmap Data
Hi,
Just been gradually switching over to AS3, and I've hit a problem and its doing my nut in because I can't find a way to get it to work.
Basically I want to take a portion of a movieclip and convert it into bitmap data into another movieclip.
I know the basis would be something like:
var b:BitmapData=new BitmapData(100,100,false);
var bm:Bitmap=new Bitmap(b);
mymc.addChild(bm);
But I can't work out how to get that to pick up the movieclip that I'm trying to extract from.
Hayyyulp.
The link below is the kind of method I want, but because this is drawn at real time it would cause the area to expand with the movie clip, when all i want is to extract a portion and place it as a surface texture. (draw on the box on the right hand side)
http://www.visitmyworld.co.uk/body.swf
Also, I don't really think it necessary to update in realtime, that and id assume generating the bitmap area in real time would cause major slowdown issues. If anybody has any different solutions to what I propose then advice welcome.
The reason id want a bitmap is that data id want to project could be complex layers, ie- items can be dragged on rather than just being drawn on.
Cheers,
Adam
View Replies !
View Related
Brightening Up Bitmap Data With Code Only?
I've got a "spotlight" image and a seperate image I want to light up using the spotlight image. I've included the images as attachments. I've also included a photoshopped version of the result I'm looking for. I tried the following (that I thought would work)
Quote:
a = spotlight.getPixel(x1,y1);
b = original.getPixel(x1,y1);
c = a * b;
mainBitmapBD.setPixel(x1,y1,c);
Instead of
Quote:
c = a *b
I've tried OR-ing the colors
Quote:
c = a | b;
I've tried to split the channels up, multiply and then combine them again
Quote:
r1 = a >>16;
g1 = a >>8 & 0xFF;
b1 = a & 0xFFFF;
r2 = b >>16;
g2 = b >>8 & 0xFF;
b2 = b & 0xFFFF;
c = (r1 * r2)<<16 | (g1 * g2)<<8 | (b1 * b2) ;
and OR-ing them
Quote:
c = (r1 | r2)<<16 | (g1 | g2)<<8 | (b1 | b2) ;
I realise these two things are the same but for some reason they give out different results sometimes...Nothing works and it's driving me crazy, anyone that can help? I've included a b/w image, but I want this to work for color images as well.
View Replies !
View Related
Saving Flash Data As Bitmap
Hi! i'm creating an application in Flash (MX 2004) where i need to save the data as a bitmap, well saving it as bitmap isnt my headache as someone else is taking care of it , but what i need to know is how can i send the data to the middleware application (.Net) which would then save it as a bitmap ?
View Replies !
View Related
Bitmap Data Object Mysteries
Hey, does anyone know of a good example of the bitmap data object where you set a threshold on one instance of the bitmap data object and then copy only the pixels over that passed the threshold?
Ultimately, I want to take one bitmap data object, select areas within it to flood fill, and then make those areas rollover areas.
Does this make sense? Anyone?
View Replies !
View Related
Saving Bitmap Data Flash/php?
Hi all
I recently downloaded a file from http://www.m3style.lv/bo/experiments/flash2jpg/
and trying make it run with no success!
I have PHP Version 5.1.1 with gd installed but when creating jpg it hangs.
===========================
Calculated after 2.328 seconds
Sending data to server...
Finished sending / GD rendering after 55.531 seconds
Loading img/rendered640.jpg...
===========================
as I opened the fla have noticed it has link to external swf "core.swf"
I tried to change the url param with following:
System.security.allowInsecureDomain("core.mochibot .com");
to
System.security.allowInsecureDomain("core.http://xyz04.sbn-sacs.de);
but it still hangs.
anybody donwloaded that file and were able to make it work?
ActionScript Code:
MochiCore = function () {
};
MochiCore.selectVersion = function(mochiClip) {
var clipUrl = mochiClip._url;
if (clipUrl.indexOf("?") == -1) {
clipUrl = clipUrl+("?v="+escape(getVersion())+"&fv=");
if (_level0._root.getSWFVersion) {
clipUrl = clipUrl+_level0._root.getSWFVersion();
} else if (typeof (System) != "undefined") {
clipUrl = clipUrl+"6";
} else {
clipUrl = clipUrl+"5";
}
// end else if
mochiClip.loadMovie(clipUrl);
}
// end if
};
if (typeof (System) != "undefined" && typeof (System.security) != "undefined") {
if (System.security.allowDomain) {
System.security.allowDomain("core.mochibot.com");
}
// end if
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("core.mochibot.com");
}
// end if
}
// end if
MochiCore.selectVersion(this);
could someone please explain me,what exactly the above codes?
View Replies !
View Related
Apply Filter To Just One Bitmap Data, No The Others?
Greetings,
I was following lee's tutorial on how to create advanced effects on bitmap data (like using the blur filter). I am not used to working with bitmap data and don't find it's creation and structure intuitive. Something I am not understanding is how to just blur a single clip and build the draw loop so that only that clips bitmap data gets drawn and blurred while other clips stay untouched. Any object I put onto the main timeline ends up bluring. I tried creative a sprite that contained the clip and then targeted that sprite, but still, any clip, or any object on the stage was blured and redrawn. Any help would be appreciated. Thanks!
Code:
import caurina.transitions.*;
var bmd:BitmapData = new BitmapData(550, 400, true, 0x000000);
var bm:Bitmap = new Bitmap(bmd);
var s:Sprite = new Sprite();
addChild(s);
s.addChild(bm);
var bf:BlurFilter = new BlurFilter(8, 8, 3);
var cmf: ColorMatrixFilter = new ColorMatrixFilter([1,0,0,0,0,
0,1,0,0,0,
0,0,1,0,0,
0,0,0,1,0]);
var logo:Logo = new Logo();
s.addChild(logo);
logo.scaleX = logo.scaleY = .14;
function mover(){
var myY:Number = Math.random()*stage.stageHeight;
var myTrans:String
myY <= logo.y ? myTrans = "easeOutExpo" : myTrans = "easeOutBounce";
Tweener.addTween(logo,{x:Math.random()*stage.stageWidth,
y:myY, time: 1,
rotation:Math.random()*300, onComplete:mover,
transition:myTrans});
}
mover();
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void{
bmd.draw(s);
bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
bmd.applyFilter(bmd, bmd.rect, new Point(0,0), cmf);
bmd.scroll(0, -5);
}
View Replies !
View Related
Bitmap Data And Dynamically Loaded Images
Hello,
I posted yesterday that I was having a problem making a bitmapData object of an image that was loaded dynamically. At first we though it may be a scope issue, but now I think the way I am loading the images is what is causing problems.
The oListener.onLoadComplete is only getting called on the last pass through the loop.
I need to make a bitmap object of a couple images that are loaded in.
Any suggestions?
Thanks,
Adam
Code:
function buildPages(){
// course title
courseTitle_txt.htmlText = courseTitle;
for (i=0; i<howMany; i++) {
// attach new item
if(pageRoot.childNodes[2].childNodes[i].childNodes[0].childNodes[0].nodeValue == "A"){
//trace("page type "+i+" = A");
content_mc.attachMovie("pageA", "page"+i, itemDepth);
content_mc["page"+i].text_txt.htmlText = pageRoot.childNodes[2].childNodes[i].childNodes[2].childNodes[0].firstChild.nodeValue;
content_mc["page"+i].text_txt.styleSheet = cssStyles;
}else if(pageRoot.childNodes[2].childNodes[i].childNodes[0].childNodes[0].nodeValue == "B"){
//trace("page type "+i+" = B");
content_mc.attachMovie("pageB", "page"+i, itemDepth);
content_mc["page"+i].text_mc.text_txt.htmlText = pageRoot.childNodes[2].childNodes[i].childNodes[2].childNodes[0].firstChild.nodeValue;
content_mc["page"+i].text_mc.text_txt.styleSheet = cssStyles;
content_mc["page"+i].text_mc.text_txt.autoSize = true;
}else{
trace("no page type: page"+i);
}
// menu
bottomMenu_mc["menu"+i+"_mc"].text_txt.htmlText = menu.childNodes[i].attributes.title;
bottomMenu_mc["menu"+i+"_mc"].text_txt.autoSize = "left";
// loader for page content - images, swf's
oListener.onLoadStart = function(imageLoader){
//trace(imageLoader+" started Loading");
}
oListener.onLoadProgress = function(imageLoader, nLoaded, nTotal){
//trace(imageLoader+" loaded "+nLoaded+" of "+nTotal+" bytes");
}
oListener.onLoadComplete = function(){
//cnt++;
}
// main pages
pageVisuals = pageRoot.childNodes[2].childNodes[i].childNodes[1].childNodes[0].childNodes[0].nodeValue;
imageLoader.loadClip(pageVisuals, content_mc["page"+i].imageHolder_mc.imageHolderInside_mc);
content_mc["page"+i].topTitle_txt.htmlText = lessonTitle;
content_mc["page"+i].title_txt.htmlText = pageRoot.childNodes[2].childNodes[i].attributes.pageTitle;
this["bitmap"+i] = new BitmapData(300, 300, true, 0xFF0000);
this["bitmap"+i].draw(content_mc["page"+i].imageHolder_mc);
tester_mc.attachBitmap(this["bitmap"+i], _root.getNextHighestDepth(), "auto", true);
curItem = content_mc["page"+i];
// put the MC in an array
section[i] = curItem;
if (i == 0) {
curItem._x = 0;
} else {
curItem._x = content_mc._width+1;
}
itemDepth++;
imageLoader.addListener(oListener);
}
}
View Replies !
View Related
Video Frame Capture Using Bitmap Data
I use the code below to capture a video frame to bitmap data. The video gets its content from my web cam. The problem I have is that the bitmap data object has only data in 160 x 120 pixels even though the video and the camera size is set to 320 x 240. I use getPixel command in the BitmapData class to read individual pixels. After 160 x 120 pixels, getPixel always returns 255. It looks like the web cam image is resized into 160 x 120 pixels. Any help is appreciated.
var camera:Camera = null;
var activity:Boolean = false;
var bitmap_data:BitmapData = null;
function initialize():void
{
camera = Camera.getCamera();
camera.setMode(320,240,10,false);
camera.setQuality(0,100);
video.width = 320;
video.height = 240;
if (camera != null)
{
camera.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
output.attachCamera(camera);
}
else
{
trace("You need a camera.");
}
}
function activityHandler(event:ActivityEvent):void
{
if(activity == false)
{
activity = true;
bitmap_data = new BitmapData(320,240, false, 0xFFFFFF);
}
}
View Replies !
View Related
Videostreaming And Client Access To Raw Bitmap Data
Using BitmapData.draw() method applied to a video streaming source (for example to obtain a snapshot) I get the following security error from the player:
SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: xyz.swf cannot access rtmp://myHost/myApp. No policy files granted access.
at flash.display::BitmapData/draw()
...
The problem could take origin from Flash Player 9 security policy, in particular the version 9.0.115 and later.
From available documentation it should be possible to set lower security levels (allowing client access to raw bitmap/audio data) with specific server configuration (cross-domain.xml, Application.xml) or server-side scripting on FMS (e.g. client.VideoSampleAccess property settings).
Nevertheless at the moment I haven’t found an effective solution.
Does anyone know a possible solution to this issue?
Beaver
View Replies !
View Related
Bitmap Data Faux Zoom Effect
Hi,
I have a request to zoom into a section of a flash site.
Im thinking of maybe using bitmap data to grab the screen, overlay it onto the site and then zoom the .jpg to give the impression of zooming into the page.
Is this practical, could this be done instantly ie. no wait for the .jpg to render, does anyone know any examples of doing this, or has anyone done this before ??
Thanks
JSAUL
View Replies !
View Related
How To Select Pixels From A Bitmap Data Object ?
Is there a way to select the pixels (or a Rectangle) say from (0, 0) to (100,100) from a BitmapData instance? Or to create a Bitmap instance where its bitmapData is a cropped section of another BitmapData instance?
I just dont know which methods to use from these two classes to achieve this... Any ideas?
thanks guys!
View Replies !
View Related
Export Vector / Bitmap Data At Runtime
Is there a way to incorporate functionality (like a button) which when pressed can either:
Copy the content of a flash movie as a bitmap
* or *
Copy the content of a flash movie as a vector
AT RUNTIME?
I don't really care how the bitmap/vector info will be stored, although I would definitely like it on the clipboard.
Any ideas on how to achive this? (If it can be achieved).
Thanks in advance,
Angelos
View Replies !
View Related
|