hi,

method 1:

you need the pixels within rectangle (x=10,y=23,width=100,height=123)
create a bitmapData of required width and height(which is
rectangle.width,rectangle.height)
when drawing the source image to the created bitmapData use
matrixObject to offset the position of the pixels to be drawn
eg:
var rect:Rectangle=new Rectangle(x,y,width,height)
var bmpData:BitmapData=new BitmapData(rect.width,rect.height)
var mat:Matrix=new Matrix()
mat.translate(-rect.x,-rect.y)//this could vary based on the scope and
position of your source image
bmpData.draw(source,mat)
add this bmpData to a displayObject

method 2:

Draw the source image to a bitmapData instance and use copyPixels
method to copy the pixels from the selected area to another bitmap

eg:
var rect:Rectangle=new Rectangle(x,y,width,height)//selected area
var bmpData:BitmapData=new BitmapData(rect.width,rect.height)
bmpData.copyPixels(sourceBitmapData,rect,new Point(0,0))
 add this bmpData to a displayObject

-sathesh

On Nov 25, 10:58 am, jakir qureshi <[email protected]> wrote:
> Hi All,
>
> how get a snapshot of a perticular area of a image.
> my requirement is that i have a image of height and width suppose 600 600,
> when i click in area whose x=10 y= 23 width =100 and height=120 how can i
> get the snapshot of perticular area of iamge
>
> --
> Thanks & Regards
>
> Jakir M. Qureshi
> Software Engineer
> Saba Software India Pvt. Ltd.

--

You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.


Reply via email to