Resize Bitmap image in image control in flex3

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Resize Bitmap image in image control in flex3

    I am loading an image in image control initially. Then I am applying color
    transform to that image and want to load that bitmap image in flex3. That is
    working, but automatic resize is not working then. If I load another image then
    auto resize is working fine. Doesnt Image control support resizing of bitmap
    object of same image?.

    Here is the portion of code:
    <mx:Image source="{imgpath}" id="myImage"
    creationComplete="imageCompleted();" x="20" y="30" width="365" height="440"
    maintainAspectRatio="true"
    />
    private function applyColor(event:Event):void{

    myBitmapDataObject = new BitmapData(myImage.width, myImage.height, true,
    0x00CCCCCC);

    myBitmapDataObject.draw(myImage.content);
    myBitImage = new Bitmap(myBitmapDataObject);

    myBitmapDataObject.colorTransform(myBitmapDataObje ct.rect, new
    ColorTransform(1, 1, 1, 1, 39, 76, 135, 100));
    myImage.removeChildAt(0)
    myImage.load(myBitImage);


    }

    Any help is appreciated.

    mousumi_78 Guest

  2. Similar Questions and Discussions

    1. image select, resize and locally store (flex3 airexample)
      Hi Jacob, I've tried out your script as it seems to be a good starter for an application I'm about to write. In my case, I don't want to create...
    2. Resize image on the fly
      Does anybody know any custom tag or snippet that can resize image on the fly based on the user's selection, ie thumbnail 300x400 600x800 ...
    3. Determining Bitmap image resolution
      Is there a way to determine the resolution of an embedded bitmap image in Illustrator. I have a client who has submitted a .png file embedded in the...
    4. Why can't I use a bitmap image over a video?
      I have a video clip. I've also created a 32 bit alpha channel image of an old TV. The idea is that the video clip plays "inside" the old TV (the...
    5. Open Image in 'Kodak Image Edit Control' with web browser.
      hi, 1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page. 2.This '.tif' type image can be...
  3. #2

    Default Re: Resize Bitmap image in image control in flex3

    You need to create the BitmapData as the original loaded image size, not the
    mx:Image height and width. You are simply transforming/copying only a portion
    of the original size that corresponds to the Image size. Ie. say you have a
    400x400 image and your Image is 100x100. Your BitmapData is being created at
    100x100, NOT 400x400 as you would need to do. Just because you resize the
    Image, doesn't mean the underlying BitmapData is also resized.

    Also, generally, addChild would be used after removeChild, never used load
    myself. Not sure if it matters.



    slaingod Guest

  4. #3

    Default Re: Resize Bitmap image in image control in flex3

    You need to create the BitmapData as the original loaded image size, not the
    mx:Image height and width. You are simply transforming/copying only a portion
    of the original size that corresponds to the Image size. Ie. say you have a
    400x400 image and your Image is 100x100. Your BitmapData is being created at
    100x100, NOT 400x400 as you would need to do. Just because you resize the
    Image, doesn't mean the underlying BitmapData is also resized.

    Also, generally, addChild would be used after removeChild, never used load
    myself. Not sure if it matters.



    slaingod Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139