Cool,
I was actually trying out my own when posted. the live docs have some
good info about display programming, and now that I have been assured it
wil reduce bloat, I am going ahead with it.
I also came up with a cute little way to generate thumbs if the image
doesn't format, and I figured that I can extend it once I have time to
make use of the elements of photography as rules to detect visual
interest. (contrast, positive negative space, rule of thirds, balance,
line and direction analyses.) Put them together, and you have the
perfect thumbnail. hahahaha
thanks for the tip on .draw
Thanks,
Anthony
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