I think MOVE effects may use bitmap caching, but I don't think RESIZE
does.

 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald
Sent: Tuesday, May 27, 2008 3:56 PM
To: [email protected]
Subject: Re: [flexcomponents] Fwd: Center/Shrink To Fit

 

I thought any effect turns a "render as bitmap" internal flag on? I know
I've put effects I didn't need on certain components that contained
textFields that weren't behaving properly (such as the text ignoring
.alpha and such).

-J

On Wed, May 28, 2008 at 1:06 AM, Alex Harui <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

I'll have to ask the player rendering guys for the exact answer.  I do
know the player works in 20ths of a pixel, so that'd be my first guess.

 

I'm not sure what you mean in the last question.  Effects or no effects,
all transforms we do attempt to not use bitmaps (unless the raw data is
a bitmap), in order to get highest-fidelity.

 

________________________________

From: [email protected]
<mailto:[email protected]>
[mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Josh McDonald
Sent: Monday, May 26, 2008 10:01 PM


To: [email protected]
<mailto:[email protected]> 
Subject: Re: [flexcomponents] Fwd: Center/Shrink To Fit

 

Yeah you're right, my bad :)

As for scaling - I'm definitely not as knowledgeable as I'd like to be
about what goes on (when dealing with non-bitmaps). What does flash do
if you scale down rather than up? Does it scale drawing commands to
sub-pixel values? What about stroke widths? Do they bottom out at say 1
or half a pixel? If you have an effect on your component, does it scale
and then convert to bitmap?

-J

On Tue, May 27, 2008 at 2:39 PM, Alex Harui <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

I'm not sure you can get at _scaleX in the override.  I would override
invalidateSize() and have it check a flag as to whether to call the
default behavior.  That's what happens in ListBaseContentHolder.

 

Going to bitmap will have smoothing problems when scaled, and take up
much more memory in most cases.

 

________________________________

From: [email protected]
<mailto:[email protected]>
[mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Josh McDonald
Sent: Monday, May 26, 2008 9:37 PM
To: [email protected]
<mailto:[email protected]> 
Subject: Re: [flexcomponents] Fwd: Center/Shrink To Fit

 

That's a great idea Alex - subclass Canvas for your scaling child, and
override set scaleX and set scaleY like so:

    override public function set scaleX(value:Number):void
    {
        if (_scaleX == value)
            return;

        _scaleX = value;

        invalidateProperties();
        //invalidateSize();

        dispatchEvent(new Event("scaleXChanged"));
    }

Although I think that will come back to bite you if you ever have
something else that changes the scaleX or scaleY on that component, as
your container probably won't be notified about the different size.

Of course, if there's no interaction with the object you're trying to
scale, I'd probably just render it to a bitmap and display that at
whatever size you please. Seems less hacky.

-J

On Tue, May 27, 2008 at 2:02 PM, Alex Harui <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

One way is to block invalidateSize when scaling the child.  See
ListBaseContentHolder

 

________________________________

From: [email protected]
<mailto:[email protected]>
[mailto:[email protected]
<mailto:[email protected]> ] On Behalf Of Richard Rodseth
Sent: Monday, May 26, 2008 12:09 PM
To: [email protected]
<mailto:[email protected]> 
Subject: [flexcomponents] Fwd: Center/Shrink To Fit

 

I haven't done any more work on this, but I thought I'd see if the
smaller flexcomponents list had any advice for me. I'm thinking maybe
I should emulate SWFLoader and use a DisplayObject as "content
container". Advice appreciated.

---------- Forwarded message ----------
From: Richard Rodseth <[EMAIL PROTECTED] <mailto:rrodseth%40gmail.com>
>
Date: Fri, May 23, 2008 at 5:00 PM
Subject: Re: Center/Shrink To Fit
To: [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com> 

Is there a way to set the scale of a component without triggering
invalidateSize() ?

My initial effort to create a "ScaleToFit" component involved setting
scaleX and scaleY in updateDisplayList. But that results in some
recursion. Perhaps this is the wrong place to set the scale.

I notice that SWFLoader uses a DisplayObject as a content holder, but
my attempts to cast "this" to DisplayObject before setting the
property didn't help - the UIComponent version of "set scaleX" is
still invoked.

On Fri, May 23, 2008 at 7:37 AM, Richard Rodseth <[EMAIL PROTECTED]
<mailto:rrodseth%40gmail.com> > wrote:
> I'm looking to find or create a component which would scale (not
> resize) its contents smaller if they were larger than this component's
> bounds, and center them if they're smaller. I could imagine
> extensions to support "expand to fit" as well, but that's not needed
> currently.
>
> The "contents" can be a single child if that helps, or the full child
> list of a container. I've done a bit of custom component development,
> but would appreciate any suggestions/pointers for this scenario.
>
> Thanks in advance.
>






-- 
"Therefore, send not to know For whom the bell tolls. It tolls for
thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  




-- 
"Therefore, send not to know For whom the bell tolls. It tolls for
thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  




-- 
"Therefore, send not to know For whom the bell tolls. It tolls for
thee."

:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  

 

Reply via email to