Hi Danny,
I've done this where I show thumbnails of the tab content in each tab.
The problem I faced originally was similar to what you allude to -
initially only the first tab's contents are drawn and the other tab
contents are not yet rendered. So how do you take a snapshot of
something that is not yet drawn on the screen? 

The way I got it to work is, after the first tab content is rendered,
force calling updateDisplayList() for each of the other tab's content
child object passing in the unscaledWidth and unscaledHeight of the
first tab child. After all tab contents are created and sized
(although not yet drawn on the screen), snapshots using the
ImageSnapshot's captureBitmapData() work fine. 

I do have very custom components and rely less on the Flex fwk for
sizing etc. but it should work the same.

Hope that helps. 

Vijay  

--- In [email protected], "dannyvenier" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Perhaps someone has tried to do this and has figured it out.  
> Me...no. The objective is to take image snapshots from the display 
> objects on individual tabs (children) of the tab navigator and use 
> them for a tile list in another container...preferrably on another 
> tab of the TabNavigator.
> 
> The problem seems to be that only the visible tab can be snapped. 
> Taking snapshots of the other non selected children produces what 
> appears to be a very narrow slice of display...
> 
> Stepping through the children, selectedIndex = i, setting that child 
> to be visible, taking a snapshot, all programmatically without user 
> interaction does not work.  Again, one valid snapshot, and the rest 
> are some machination of some image with positive size, but only a 
> slice.  I've done quite a bit with snapshots before so I'm confident 
> in that part of the code (getting the snapshot of bitmapData, using 
> it to form a Bitmap Object, wrapping in UIComponent, adding as child 
> to container), and I'm picking up one successfully but no luck on 
> picking them all up.  I set breakpoints at the first point of the 
> snapshot and the size tells me its not the full display object.  I'm 
> sticking the snapshots in a model and using to source the list.  The 
> copy in the model has only the single full image.   
> 
> I've even tried making a copy of the display objects themselves and 
> presenting them in the tile list but for whatever reason, the instant 
> I add the child to the tilelist container, it is no longer visible in 
> the original tab.
> 
> Its a barchart image I'm trying to capture so I try
>          var cloneBarChart:BarChart = new BarChart();
>          cloneBarChart = this.barChartDisplay as BarChart;
> 
> but as I mentioned, the minute I add the cloneBarChart as a child to 
> the tilelist container, the original barchart disappears from the 
> original tab.
> 
> I didn't include code cause its a bit spread out.  I'm just wondering 
> if I'm missing some characteristic of the tab navigator or a 
> viewstack that makes hidden children inaccessible?  It could be a 
> creation sequence problem but setting the selected index and 
> visibility should force creation, no?
> 
> thanks,  
> Danny
>


Reply via email to