ActionScript :: Flash - Bitmap Caching Vs Image Asset Performance
Mar 14, 2011
i've created a full spectrum color wheel Sprite object that is composed of 1440 vector triangles, or slices if you will. since i want to animate the color wheel, i've activated the display object's cacheAsBitmap property. however, caching the vector as a bitmap does not increase performance during animation it remains slow, jumpy. importing a PNG screenshot of the color wheel into the library with lossless compression, converting it to a Sprite, and rotating this new image asset performs great during animation. why does an uncompressed PNG image asset import out perform the same vector image with cacheAsBitmap property set to true?
View 1 Replies
Similar Posts:
Oct 8, 2010
Im trying to fix some as classes that are importing from mx.core.* and have defined a Class that extended the BitmapAsset class--I dont believe that class exists in the Flash library, so I replaced them all with BitmapData--Can someone explain what mx.core is and what is the Flash equivalent of BitmapAsset?
View 3 Replies
Dec 14, 2009
In Flash what would be wiser? To use a PNG or import the vector and cache it as bitmap?
View 1 Replies
Aug 7, 2009
Use the flash CS4 tool's on a bitmap image after tracing the bitmap image and applying my settings?
View 10 Replies
Aug 28, 2011
1. I've read that when Bitmap Caching an object, if the objects you are caching are bitmaps that all point to the same bitmapData object, than only one instance is cached and used by the GPU. However, if the bitmap contains a scale, does this hold true, or is a new bitmap cached for each object because of the new scale? I'm pretty sure its the second one, just checking.
2. When using cacheAsBitmapMatrix, I've seen examples setting the matrix to identity, and setting it to the concatenated matrix of the bitmap object. Can someone explain the difference between the two approaches? I would assume setting it to identity doesn't scale it up or down when caching is as stated in the documentation:
"The matrix transformation you apply to the cacheAsBitmapMatrix property is applied to the display object as it isrendered into the bitmap cache. Thus, if the transform contains a 2x scale, the bitmap rendering is twice the size of thevector rendering. The renderer applies the inverse transformation to the cached bitmap so that the final display looks the same."
But if this bitmap is nested in a sprite that moves throughout the scene, will the bitmap still move with it? Or will I need to update the matrix's x/y everytime I update the sprite's x/y. If this problem exists, does using the concatenated matrix get around it.
3. Finally, I have seen some sites state that more gpu memory is used when cacheAsBitmapMatrix (such as an additional copy of the texture being pushed into the gpu), but I was under the impression that this would just rotate and scale the texture in memory using openGL matrices. Why would more gpu memory be used when cacheAsBitmapMatrix is set?
My understanding is that when designing for mobile, if the graphic isn't too large, and the object doesn't contain nested animating objects, the best approach is to cacheAsBitmap and cacheAsBitmapMatrix on the object to ensure it won't be pushed to the gpu each frame, but feel free to correct me if I'm wrong. Adobe states "Always set the cacheAsBitmapMatrix property whenever you set cacheAsBitmap to true in content created for mobile devices."
View 4 Replies
Oct 12, 2009
I am doing a flash that getting images from Database. Here is my problem, if I dont close my flash, Whenever I update the images in Database, flash doesnt update the image at the same time. (if I have the image at frame 1, then i go to frame 2, then i update Database, now i go back to frame 1 again, the image is not updated.) It seems like the Loader is caching the image. How can I update my image? Anybody knows why?
View 5 Replies
Aug 15, 2008
I have this RPG-like screen where you have a character walking through.. the forest or something.. and the thing is.. it's lagging.. LOTS..On that scene.. there are quite a lot of Tree graphics and grass graphics.. I've tested this and apparently graphics run a lot smoother than movieclips with bitmap caching on..Also.. My character has lots of different hair styles all put into one movieclip.. and i thought that by removing them all.. and just have a attachMovie() script to pull in the appropriate hairstyle clips.. it would go faster..but apparently it doesn't seem to of made much difference..what other ways can i reduce the lag on flash?
View 1 Replies
Aug 12, 2011
I have a web application developped using as3. The problem is that these application loads some image files, and add my watermark to them.What is happening is that these images are being cached by the browser, allowing the users who know how to access the tmp folder, to get these files, without my watermark.Adding the watermark previously to the image, is not an alternative for me, due the fact that when the a premium user is logged in the watermark is not added.How can I disable the caching?
View 3 Replies
Oct 12, 2009
I am doing a flash that getting images from Database. Here is my problem, if I dont close my flash, Whenever I update the images in Database, flash doesnt update the image at the same time. (if I have the image at frame 1, then i go to frame 2, then i update Database, now i go back to frame 1 again, the image is not updated.) It seems like the Loader is caching the image. How can I update my image?
View 3 Replies
Dec 15, 2009
I've been developing an application which uses a lot of sprites to create a 'wheel of fortune'-like object. Since I use several filters, sprites, countless calculations, and various other tricks to draw it, it became painfully slow to try to spin that, as flash had to redraw everything every frame.
Needless to say, I took the bitmapData 'snapshot' approach - I drew the massive combined sprite to a bitmapData, removed the original sprites, filters, et al from the display list and nulled them, Threw the BMD into a Bitmap object, placed that in a container sprite so that I wouldn't have to continually use a matrix to rotate from the center when it registers at the top left, and started rotating the container.
Unfortunately, it seems that rotating the container with this 500x500 Bitmap in it is nearly as slow as it was when I hadn't snapshotted it and rotated the whole thing, filters and all. I have already played with the BitmapData's transparency, turned on and off cacheAsBitmap on various combinations of containers and the bitmap itself (hahaha), checked the Bitmap.smoothing property out, blah blah blah, the whole nine yards. Rotating a decently sized Bitmap (thus making pre-rendered/calculated frames a really bad idea) ... how do I make this run at a tolerable speed without eating my CPU and turning the fans on?
View 7 Replies
Feb 28, 2012
I have a project where i'm drawing to a stageSized bitmap by using BitmapData.drawusing the 'show update regions' feature of the debug player, i can see that the player always updates the whole stage although i changed only a small part of the bitmapdata.Can I somehow make the player only update that part of the screen where there were changes made to the bitmap data?
View 2 Replies
Nov 26, 2008
for the past couple of weeks I've been learning AS3, and for a school project I'm doing a remake of the popular DOS game Liero. Everything is working fine, I got a layer of dirt that I am shooting away, but the problem is that after a few hundred bullets, the game starts to lag heavily whenever a shot is fired.I'm using a simple bitmap and a brush to erase the parts where the bullets hit.
// Drawing stage
bmap = new BitmapData(1100,800, true, 0);
dispBmp = new Bitmap(bmap);
[code]...
View 1 Replies
Oct 22, 2011
I have a var that holds the String value for the path to an image. How can I use that to get the ByteArray from that image synchronously?
View 1 Replies
Feb 28, 2011
I've done quite a bit of digging but it's surprisingly difficult to find informed answers to these questions. I'm making a Flash game with a friend; as far as we can tell, the code is fine, but there are some serious framerate problems that seem entirely related to the graphics.
Is there a performance difference between Movieclips as JPGs and PNGs? Most of our graphics are imported as PNGs because they have transparent sections, but I don't know whether there is a performance difference between setting image compression to JPG or PNG within Flash itselfDoes turning on "Smoothing" for an image affect performance?Obviously larger graphics have more of a performance hit, but is there any benefit to splitting a large image into pieces? Example, changing a 2000*1000 background into two 1000*1000 pieces? One thing is most of our graphics are as much as twice the size in the library as they are displayed onscreen, then scaled in the code. We had wanted to make the game still look good when zoomed in/fullscreened but that doesn't seem practical so I'm planning on resizing all of the image files to their final size in the game and removing the scaling code. Hopefully that's the major part of the problem.
View 2 Replies
May 10, 2010
What I would like to do is to take a loaded GIF file as a Bitmap and then distort it by stretching and shrinking parts of it, so it would look like it got squished up against the screen. I'm pretty sure that there's no easy way in Flash to go beyond scaling and shearing, but I wonder if there might be some simple techniques to accomplish this kind of effect. By the way, I've also thought of pre-deforming the images in GIMP and saving them there, but I can't find a simple way to do it without learning their scripting language.
View 1 Replies
Nov 15, 2011
I've been tasked to write a chat engine in actionscript3 (AIR) and every chat message has an image of the poster associated with it. So I have 5 chat messages on the screen at any one time but it will be obvious that the images associated with message e.g. #1 changes all the time because the last person posting is different.
What I believe is wrong is to use the .addChild method every time I need to replace the image because it will just keep creating more stuff on the stage. What I tried to do is the code below but it refuses to update the image. The way I thought it should work[code]...
View 1 Replies
Jan 21, 2010
I have an externally loaded swf that contains thumbnail movieclips. When a thumbnail is clicked an external image is loaded. I would like to be able to reposition this external image. I know I can use typecasting to control a movieclip of the swf but how do I control nested externally loaded files? I have a different approach that should work fine but I was just curious about my initial attempt.
View 0 Replies
Apr 30, 2010
I want to convert bitmap data to an image file like jpg or png file in AS3.
View 1 Replies
Feb 18, 2011
I am making a snow boarding game in AS3. The problem I am having is that I want to leave a trail in the snow behind the board.
I have had a think and feel that the best way of achieving this would be to use the lineTo() method to draw a line form the snowboards previous position to its current position. If I do this all of the way down the slope I would end up with a line almost 23000 pixels long which seems extremely large and will have a major impact on performance.
If I were to convert the trail movieclip to a bitmap would it improve performance? I am targeting a minimum of flash player 9 which I have found to have issues when handling bmp's over 2880 pixels so I think this method might not work.
View 2 Replies
Apr 26, 2011
In Photoshop there is a tool that lets you adjust the levels of an image. I'd like to be able to do the same thing. I've seen examples online that show the levels but they are for each individual color channel (red, green, blue or alpha or CMYK) but not a combined view like in Photoshop Input Levels (see below).Also, as a bonus is there a way to find the best shadow and highlight input level settings, basically the settings the Auto level button determines?Update:I think I'm closer but I'm not sure. Here is the method I pieced together. The first image is my results and the second is Photoshop results both analyzing the Google logo:Update 2:Ok I think I got it. The code is below. It's mostly working all the time, mostly. Additional credits:Photoshops results:
Levels method:
/**
* Get a histogram of the grayscale levels
[code].....
View 1 Replies
Nov 9, 2010
I'm making a flash movie and I'd like to load a background image into my SWF and paint it to the stage using the Bitmap and BitmapData classes. Am I approaching this properly? What code gets the image from the Loader to the BitmapData? Also, how do I get the image to show in the background? I've never understood the BitmapData/Bitmap metaphor, explanations, code samples and tutorial links.
View 1 Replies
Aug 6, 2010
Is it possible in flash to get a specific frame in a flv video as a bitmap or an image.?
i saw an example of it online but as the comments said it didnt work and some said that its not possible.
View 4 Replies
Oct 12, 2011
I load a bitmap to the stage, it's a GIF and set to lossless compression. I have ensured its coordinates are integers and have not allowed smoothing (smoothing somewhat fixes the issue but reduces quality of the image).The problem is the image appears to shift one pixel to the left and add that pixel on to the right side meaning one side has no border and the other a double border.The original bitmap does not have this issue, and there is no transparency .etc in the image.
View 1 Replies
Dec 30, 2009
I have this PHP page that lists several people. When someone clicks on one of the people they are sent to another PHP page that has their video greeting in a .swf embedded into the page. This works by the php writing the path to the greeting video to the xml file that the .swf loads and plays.
Well in firefox it works perfect, but in IE when they try to click on another greeting the original greeting still plays. Its like the swf is caching the first greeting and refresh of the page does nothing to alleviate this. Is this a problem with the swf caching? or XML caching? or am I totally clueless?
[Code]...
View 1 Replies
Sep 11, 2010
I'm building an image viewer that has violent content (video games), and so it requires users to enter their birthdays. Problem is that because of company policy, I can't expose any of the source images being viewed in the event that someone might use their resources/net tabs (or just sniff the request) and get the direct link to the image. (I know that they could screenshot it, but that's out of anyone's control and not something I'm worried about.)Is there anyway to inherently mask loaded resources (images)? I've been using sockets, which is great, but there's also the problem of actually loading the image binary (after HTTP request headers are removed) as a Bitmap in Flash.
View 4 Replies
Sep 12, 2011
this is what i'm trying to accomplish; With a click on a movieclip (cannon_mc)a shot is being fired (ball_mc)
The longer mouse is down, the speed of wich the ball is fired with should increase.My question to you is;
What is the most efficient way to accomplish this? With a timer or something like this;
[Code]...
View 2 Replies
Jan 11, 2011
I'm devloping some library classes for flocking/steering behaviours on large numbers of objects (2000+). I'm finding that at < 500 instances, performance is reasonable. As the numbers increase, framerate bogs down.
I've seen remarkable performance with libraries such as Flint or Box2D with ridiculous #'s of particles / objects, so it should be possible to optimize / refactor my code to be a bit better.
I'm aware of the basic optimizations, such as bitwise operations and optimized for loops. Are there any more fundamental approaches I should be considering? For example, currently each instance is a vector-based MovieClip. Would working with BitmapData be more efficient?
View 1 Replies
Nov 4, 2011
Will I take a big hit in performance using nested ViewStacks? Should I strive to handle all navigation in one ViewStack and push children manually or will the affected performance be negligible?
eg.
<viewstack>
<tabnavigator />
<tabnavigator />
<tabnavigator />
</viewstack>
View 2 Replies
Mar 19, 2012
We have a medium size Flex 3.6 application that contains around 20 different page views (managed via a single lazy ViewStack) each having multiple components. Most use custom renderers.All model data is loaded at startup and changes to model instances are communicated via binding and/or collection change events.Once the user has viewed each page at least once, all page views are instantiated and happily listen to update events.Which in effect means that each time a model instance changes, all interested views receive that event and compute derived data or trigger item-renderers.I have tested and confirmed this behaviour in a proof-of-concept application. Even when setting a list to being invisible, it still listens to collection change events and invalidates any renderer affected.What would you do?
View 1 Replies
Aug 2, 2010
I have a Symbol in Library with linkage name: box_mc
import flash.display.MovieClip;
import flash.events.Event;
import Src.smoothAnimate;
[Code]...
but when run is make error:
1151: A conflict exists with definition box_is in namespace internal.
i want when flash run, the box_is will be add in stage, resize by function changesize.
View 1 Replies