ActionScript 3.0 :: Creating Bitmaps From ARGB Strings?
Mar 31, 2010
what's the fastest way to dump your data (not from a file) into a bitmap for display?I have it working with setPixels and colored rects but that's way too slow.Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
View 11 Replies
Similar Posts:
Apr 1, 2010
in actionscript 3, what's the fastest way to dump your data (not from a file) into a bitmap for display?
I have it working with setPixels and colored rects but that's way too slow/inefficient.
Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
What would be the best/fastest--should I start writing a byte encoder?
View 1 Replies
Mar 31, 2010
BTW, this should be in actionscript 3.
What's the fastest way to dump your data (not in a file) into a bitmap for display?
I had it working with setPixels and colored rects but that's way too slow.
Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
View 0 Replies
Feb 25, 2009
I have a large number of bitmaps, all of different shapes and sizes, and all with associated data (i.e. name, description, cost, weight etc). I want to get all these items into AS in a data structure.Based on what I know I could put together an XML file and parse that and then load each bitmap individually, but that could be very slow as it would mean loading lots of little bitmap files one at a time.I could put all the bitmaps into one big bitmap and store their xywidthheight in the xml as well so that I only have to load one bitmap but that seems a bit tricky, especially if I need to add or remove items.
I could embed all this into a class and have it load everything at compile time which is ok but not very friendly to people who aren't programmers and or don't have the source file to recompile.Is there something i can do using maybe flash to create bitmaps with additional properties and put them all in a swf that would be easy to edit by anyone using point and click?
View 8 Replies
Dec 27, 2010
If I remove the variables and just type in the path name, the file does play. So there's no other error in this piece of code. I just can't seem to figure out how to create that filename from variables.
EDIT: I should point out more clearly its about the line = public var soundRequest:URLRequest = new URLRequest("sounds/" + Champ + soundType + ".mp3");
I get a 2044 unhandled ioerrorevent error and a 2032 stream error.
[code]....
View 9 Replies
Jul 31, 2009
I'm trying to figure out the best way to compare a single bitmap against perhaps an array of saved bitmaps to see how close of a match it may be to any one of the bitmaps stored in the array. Right now I'm running a for loop that uses the bitmapData.compare() method to try to compare to see how much of a variance there is but... to be honest I'm at a loss as to how to use the resulting data to do so. Does anyone know of any good method to accomplish what I am trying to do? Forget looking at my code it's a waste of time because simply, it's not working.
View 4 Replies
Mar 3, 2010
i'm studying getPixel32() and the Bitmap and Bitmap Data classes.Basically, i'd like to know how to output a simple trace of an ARGB from a hexadecimal value.as an aside, i'm under the impression, which i assume/hope is wrong, that hexadecimal values can't produce as many colors as RGBA values.perhaps "web safe" has thrown me off with understanding the usefulness or desire to use colors produces with hexadecimal values.
View 1 Replies
Mar 21, 2011
How is it possible to create an ARGB value from an RGB value (ex: 0x00FF00) and an alpha value (ex: 0.5) ?
View 1 Replies
Aug 24, 2009
I work on AS3 one week, and then take a break for a few weeks, then work on it a day, take a break, etc.. So I forget some of the basics, and need refreshers. I think I need to stop taking breaks.
Problem: I push multiple strings into an array, and some of the strings are the same.
Code:
var myArray = new Array();
myArray.push (Snivvle);
myArray.push (Kirupa);
myArray.push (Snivvle);
I want to find out which element positions "Snivvle" hogs up. We can see that it would be using element 0 and 2, and if we do an "indexOf" we would only get to see element 0, and doing a "lastIndexOf" we would only see element 2. How do I find out ALL of the element positions "Snivvle" is located in, so that it returns: element 0, element 2.
View 2 Replies
Nov 1, 2011
I have colour values from a Flash application that are ARGB format(A being the alpha/transparency value). I have to convert that long decimal number to a RGB/Hexadecimal number in Javascript. Do you know how I can extract the individual R, G, B & A values from a long(8 digit) number? Here's my function which converts a number to hexadecimal BUT its not good enough because it needs to convert the values individually(R,G,B,A):
[Code]....
View 2 Replies
Jan 15, 2009
I have a movie clip that I add Bitmaps by using addChild(). I was wonding how would I go about displaying the next image that I added because as of now it is stuck on the first image.
View 3 Replies
May 6, 2010
I was wondering which method would be the most efficient (run faster)...Lets say I have multiple layering of animations, say a moving sky, then birds, then fireworks ordered respectively. Is better to have one bitmapdata (called BD) then do a copypixel of sky, then bird, then firework at every tick (I'm using a timer) and put it in one bitmap.
Or is it better to have 3 bitmaps (and put into 3 different sprites) with the animations separated, so when I update the birds I don't have to update the sky.share any knowledge on pros or cons of using multiple bitmaps vs using one bitmap in that situation. Aside for the increase of initial memory used.
View 5 Replies
Nov 18, 2009
I'm loading some external images and trying to get them to smooth, but for some reason it's not happening. i've been trying everything i can find on the internet over the past 10 hours or so, and nothing's worked.The code on my movieclip (first frame) is:
[code]...
my images are very high-res, so i know it isn't a resolution issue. anyway, they look crappy when they're sized down too. also, i'm pretty sure smoothing is the issue, because i have a very similar image in the library (a detail from the same shot, and similar resolution, etc.), and it looks great when i allow smoothing in the bitmap properties panel.
View 3 Replies
Dec 16, 2010
I want to know if there is a faster way to take several bitmaps and arrange them one after another in a single layer in a movie clip.
This is how I am doing it currently.
Stage 1: Import the bitmaps to the stage
Stage 2: Distribute the bitmaps to layers
Stage 3: Make the first bitmap a movie clip symbol and cut the other bitmaps' frames
Stage 4: Go into the symbol, create a new layer, and paste the frames.
Stage 5: Click and drag the other frames into one layer, one after the other.
I now have a single movie clip with all my bitmaps ordered one after the other in the timeline.
View 2 Replies
Oct 28, 2011
I have a Bitmap where I can draw on. After some seconds I want to let the drawing fade away and blend over to the original picture/bitmap. Can I do this with the blend mode by drawing the original bitmap on it? I tried something like this and of course it isn't right. Just copying the alpha channel if I get the documentation right.
dstBitmapData.draw(srcBitmap,null,null,BlendMode.ALPHA,null)
dstBitmap = new Bitmap(dstBitmapData);
I want to put some percentage to the destination bitmap. So that after doing this some frames the original picture will be visible. As the user can interrupt this by start drawing again I want to use the BitmapData object dstBitmapData.
View 1 Replies
Oct 20, 2009
I wish to add some 3D bitmaps to my 2D game. Everything is currently drawn via copypixels into the only movieclip and that is rendered. Am I correct in that I need to create (for example) a sprite, add a bitmap to it, perform all my 3d transformations and then simply .draw the result into my bitmap? If so are there any simple examples of doing so, also what about camera, focal length, perspective etc. etc. Are they taken into account before the .draw?
View 0 Replies
Mar 17, 2012
I'm working on better performance on mobile device with gpu rendering set to on. I use only bitmaps for animations, but I have some doubts:
1. If my content is poor bitmap (jpg or png file) should I cache its container as bitmap?
2. Shoud I use cacheAsBitmapMatrix for my bitmaps to have smoother animations or poor bitmaps are already optimized?
View 0 Replies
Feb 27, 2009
I have a jpeg that I have exported to actionscript via the library. The jpeg class is "adcouncil". If I want to add it to the stage I would use the following code:
Code:
var adcouncil = new adcouncil1(150,150);
var myImage:Bitmap = new Bitmap(adcouncil)
printMC.addChild(myImage);
The problem is that I want to ad these Bitmaps to the stage dynamically. My first instinct is:
Code:
var adcouncil = new this["adcouncil1"](150,150);
var myImage:Bitmap = new Bitmap(adcouncil)
printMC.addChild(myImage);
[Code].....
View 2 Replies
Apr 18, 2009
Trying to add EventListeners to Bitmaps.Can I add an EventListener directly to a bitmap?If I load an image to a UILoader then addEventListener to the UILoader instance that works just fine, but if I use a Bitmap instead, nada...I could load the Bitmap into a Sprite and add the EventListener to that, but would prefer the direct method...
View 4 Replies
Feb 25, 2011
Sometimes I have a problem publishing to an xfl file. The bitmaps in the library do not save with the xfl save to the LIBRARY folder. I've tried resaving as another .fla before re-exporting as an xfl. but I do not seem to find the proper way to overcome this?
View 1 Replies
Jul 22, 2009
I'm having an issue where after 24 bitmaps are placed inside a sprite, the first bitmaps start to disappear. When the last added Bitmaps get removed from the display list, the older ones start to reappear. Go here and check it out: http:[url].... draw 24 dots or whatever with the pencil tool (the only one that draws to a bitmap). You should notice that the 24th dot will cause the 1st one to disappear. Undoing (which simple removes the top bitmap/sprite) causes the 24th one to be removed (which is correct) but the 1st one also reappears which means its still there just not visible .Here are the relevant methods:
Code:
private function nextShape() : void {
newShape = new Sprite();
newShape.mouseEnabled = false;[code].....
View 11 Replies
Jan 20, 2012
I'm confused by a tip in Adobe's own documentation that says:Avoid using gradients, because they require many colors and calculations to be processed, which is more difficult for a computer processor to render.I understand how this would be true in a vector shape fill, but they aren't specifying vector. It seems to be implied they include bitmaps too, since the next couple tips are bitmap related.If they do in fact include bitmaps in this tip, can someone explain to me how this is possibly true? In a bitmap a pixel is a pixel. I don't see how it matter that the pixels form a gradiated color or not, the software still has to read and write each pixel regardless.
View 1 Replies
Nov 13, 2007
I'm looking for a good method to resize bitmap images to fit within the constraints of a container object whose size will change based on the browser window dimensions, etc. Basically, it needs to scale to fit. I'm using the following for resizing by height. "largeImage is a bitmap object.
[Code]....
View 2 Replies
Apr 24, 2009
I would like to have a SWC file with many bitmaps stored in it, which can the be called and loaded dynamically when they are needed.The SWC has been made, with the Bitmaps set to export.In my main class I am running into trouble trying to access these classes.Different sources are offering different advice, could someone advise the best way to gain access to these classes within the SWC, and the best way to access the SWC from within my file.URL]they offer a solution which involves having to statically name the classes at runtime (these arent exported bitmapdata classes but same idea)this second link is a person describing a solution to the problem described in the first link. His solution involves what appear to be either flex or command line compiler directives
View 2 Replies
Jun 25, 2009
I'm working on a flash website that consists of 3 frames (1 = preloader, 2 = instances of symbols, 3 = the main page/view). I've gone through and optimized all my static bitmaps/movieClips and removed any symbol that I've exported for ActionScript from exporting in the first frame. Even after all these steps frame one is still the longest to load (797kb on a 32.6 kbps simulated download), only showing the preloader when the whole file is at 86% complete. Any further steps to take to get frame one's size down?
View 3 Replies
Sep 22, 2009
I've imported 29 bitmaps into my library (gifs, each one 1728x1152, size ranges from 4-14kb, in each case the vast majority of the image is transparent). I add each one to the stage in the following manner:
var img1Data = new img1(1728,1152);
var img1Map = new Bitmap(img1Data);
containerMC.addChild(img1Map); // MovieClip to which all of the bitmaps are added
[code]......
View 12 Replies
Oct 12, 2010
I has a series of bitmaps which have been broken apart in flash, I want to know if it is possible to go into these bitmaps using their bitmapdata and edit them based on information on the arrays that I get. I.E. I want to delete the transparent pixels each one has.
Obviously I can do this by hand in photoshop or just using the lasso tool, but I have several thousand bitmaps that I have to edit, so I'm hoping theres a way to do this through code.
View 8 Replies
May 25, 2010
i've used a Loader and URLRequest to download a .png from the internet and add it to my display list. since it's already a bitmap, does it have built in bitmap data already? or do i have to create the bitmap data myself?also, why does the same trace statement return false in the mouseMoveHandler when it outputs true in the displayImage function?
var imageLoader:Loader = new Loader();
imageLoader.load(new URLRequest("http://somewebsite.com/image.png"));
imageLoader.contentLoaderInfo.addEventListener
[code].....
View 1 Replies
Mar 9, 2011
I would know if with AS2 it's possible to load programmatically a bulk of images and save them in an array; then how to attach programmatically each image to an empty movieclip.
I know how to do this in AS3 however it seems impossible in AS2.
View 2 Replies
Mar 25, 2011
I'm trying to position an image on top of another image based upon the make-up of the smaller image. The smaller image is a cut-out of a larger image and I need it to be positioned exactly on the larger image to make it look like a single image, but allow for separate filters and alphas to be applied. As the images are not simple rectangles or circles, but complex satellite images, I cannot simply redraw them in code. I have quite a few images and therefore do not feel like manually finding the position of each image every and hard setting them manually in actionscript. Is there any way for me to sample a small 5-10 sq. pixel area against the larger image and set the x and y values of the smaller image if a perfect match is found? All the images are in an array and iterating through them has already been set, I just need a way to sample and match pixels. My first guess was to loop the images pixel by pixel right and down, covering the whole bitmap and moving to the next child in the array once a match was found, leaving the matched child where it was when the perfect match was found.
View 4 Replies