Setting the resize mode on a Spark BitmapImage object in Flex Gumbo

The following example shows how you can set the resize mode on a Flex Gumbo BitmapO,age object by setting the resizeMode property to one of the static constants in the BitmapImageResizeMode class.

Full code after the jump.

To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see “Using the beta Gumbo SDK in Flex Builder 3”.


<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx=""
        <s:VerticalLayout />

            import spark.primitives.BitmapImageResizeMode;

            protected function dropDownList_selectionChanged(evt:IndexChangedEvent):void {
                bitmapImg.resizeMode = dropDownList.selectedItem;

    <mx:ApplicationControlBar width="100%" cornerRadius="0">
        <mx:Form styleName="plain">
            <mx:FormItem label="resizeMode:">
                <s:DropDownList id="dropDownList"
                        prompt="Please select a resize mode:"
            <mx:FormItem label="percentWidth:">
                <s:HSlider id="sliderH"
                        liveDragging="true" />
            <mx:FormItem label="percentHeight:">
                <s:HSlider id="sliderV"
                        liveDragging="true" />

    <s:Group width="100%" height="100%">
        <s:BitmapImage id="bitmapImg"
                verticalCenter="0" />


This entry is based on a beta version of the Flex Gumbo SDK and therefore is very likely to change as development of the Flex SDK continues. The API can (and will) change causing examples to possibly not compile in newer versions of the Flex Gumbo SDK.

4 thoughts on “Setting the resize mode on a Spark BitmapImage object in Flex Gumbo

  1. Hi,
    I would like to be able to implement support for partial downloads of large files in my app. (i.e. if the connection broke or user stopped the download partway etc)

    It appears as if there are no solutions for being able to use content-range, range-request HTTP headers in either UrlStream w/UrlRequestHeader or anything in AIR/Flex/AS3? Is this true?

    Any pointers appreciated as to how this could be implemented or if anyone knows of any existing libs/tools out there that do this.

Comments are closed.