Now when I scale the image it won't display... OMG. this is nuts.
I thought I had it all figured out, and then wham... it won't work.
Glen Pike wrote:
|Hi,
Something like this:
import flash.display.Bitmap;
import flash.display.BitmapData;
//original image in here
container.width /= 10;
||container.height /= 10;|
//maybe invalidate if it does not redraw??
|
var a:BitmapData = new BitmapData(container.width, container.height);
var b:Bitmap = new Bitmap(a);
addChild(b);
a.draw(container);
container.visible = false;|
Anthony Pace wrote:
Examples?
Glen Pike wrote:
Hi,
The only way to reduce the memory size of a bitmap is to resize
it and reduce the number of pixels.
If you are loading images from the server, you might want to
think about generating smaller images server side - you may only
have to do this once when the image is uploaded, so this may be more
useful if you don't require lots of different sizes / unknown sizes
at runtime - depends on the project. Wordpress among other things
does this quite nicely for you at upload time (when the Wordpress
coders stop moaning about FP10 and fix the uploader, it will be even
nicer) and there are lots of scripts which are variations - resize
on the fly & cache, etc.
For client side - reduce the size of the container, then draw the
bitmap image of this into a new bitmap data object - you should then
have a smaller image and you could discard your container'd one.
Glen
Anthony Pace wrote:
I can do it by reducing the size of the container object; yet, the
bitmap remains the same file sized and can be scaled well.
Is there a way to guarantee the memory usage drops? or at least a
better way then mine?
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders