wait - UIComponent.graphics is not a something that could be drawn - it is object that decorates UIComponent with drawing features, right? So you probably need to draw your component instance into bitmap data and then encode that bitmap data byte array into bytes that could be saved locally, something like in that sample:
Thanks for your reply.
I have a image stored as JPG but it looks like there is limit to the number of pixels a BitmapData object can have i.e 16,777,215 pixels. But the image I am saving would exceed this limit in many scenarios, any idea how to overcome this limit?
Do you know what "stitching" is?
So instead of drawing entire component you could specify clip rectangle to have composite image based on e.g. 3 different individual images.
(i'm not sure - based upon tech note linked above - if you could have such large display object/sprite without it being clipped by runtime)