3 Replies Latest reply on May 17, 2008 8:46 PM by slaingod

    Image Cropping using Flex

    kalyanvarma
      Hi All,

      Can anyone help me with an approach to do image cropping using Flex? It is really helpful if I can get it fast.

      Thanking you in advance.
        • 1. Re: Image Cropping using Flex
          slaingod Level 1
          You can either use image x/y and height/width to just show the portion of the image you desire, you can check into using the BitmapData.copyPixels method to copy a portion of one image into a new one.
          • 2. Re: Image Cropping using Flex
            kalyanvarma Level 1
            Hi Slaingod,

            Thanks for you reply. But the requirement here is the user should be able to select the area and get the image of the desired area he selects. So, how to get that select tool.

            Thanking you in advance.
            • 3. Re: Image Cropping using Flex
              slaingod Level 1
              You can use mouse events and anything that draws a rectangle (even Canvas or TextArea) and use the borders for your selection.

              I'm sure if you did a google for Flex selection rectangle there would be examples. Quasimod has an old AS2 one for 'marching ants' selection, that could be adapted.

              Here is some partial code that will get you going...may not contain everything you need, but certainly shows the important pieces...