View Full Version : Doesnt Scale9Grid work with bitmap?
ven
August 1st, 2007, 08:44 AM
I have uploaded a test here (http://fuglefjellet.no/concepts/scale9/)
a2.width = 300;
a2.height = 300;
b2.width = 300;
b2.height = 300;Both clips in library have scale9grid enabled, but it just wont apply to the imported bitmap, just vector.
If there is no way around it, I cant imagine it is too hard to write a custom class that applies scale9grid to the bitmap aswell, maybe someone know if it has been made already?
trace(a1.scale9Grid); and chop the bitmapdata manually?
TheCanadian
August 1st, 2007, 09:32 AM
I think you may have misunderstood the use of scale9Grid. Read this:
http://livedocs.adobe.com/flex/2/langref/flash/display/DisplayObject.html#scale9Grid
The reason the vector is smooth and the bitmap is pixelat3ed in your example is because the vector image is calculated and redrawn every frame from stored information which means you can scale it without loss of quality. The bitmap is pixelated because it just consists of the originally designated pixels and, when you scale it, Flash must sort of guess what colours the new pixels in the bigure picture must be.
senocular
August 1st, 2007, 11:42 AM
You can divide a bitmap into 9 bitmaps to fit into each quadrant of the 9-slice grid in the authoring environment to have it work with 9-slice scaling. I don't think there's any way to divide it with ActionScript, though. The ActionScript approach would require that you scale the bitmap through ActionScript every time the object is scaled (and without 9-slice applied since that will probably screew it up)
GrndMasterFlash
August 1st, 2007, 11:49 AM
you could always do a modify > bitmap > trace bitmap, and make your bitmap vectors (though the quality isn't always up to par, it depends on the complexity of ya image), :mountie:
ven
August 1st, 2007, 12:05 PM
The purpose is skinning a light little framework with bitmaps from photoshop, so im developing a script that snapshots the 9 parts of the scale9grid now, and returns a new movieclip with individual split movieclip, and then scales it properly. That way our designer can easily push out design for the 9.0.16 compatible scrollpane and alike components without creating one gazillion png's.
appuatchi
April 14th, 2009, 07:32 AM
Hello everyone,
Im doing a project in which i need to work with uploading image & zoom a relevant part of the image when the user either clicks or double clicks on that relevant part. So can i use scale9grid for this purpose?? If so, how??
Pradeep
Anogar
May 4th, 2009, 11:05 PM
If you just break apart the bitmap (ctrl + b) and then distribute the right bits to different layers it works pretty much as advertised.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.