tags:

views:

28

answers:

2

Although it is hard to explain, I am writting to find a solution. I added a panel to scene which has a background image. But also, I want that panel to grab the part of background picture where it is placed. When I move that panel on runtime, it should move with its background picture part (like selecting part of a picture and dragging in paint). Is it possible?

Thanks in advance (I am sorry for my bad english)

A: 

You would have to use another ImageView on the Panel using the same Image used for the Scene background. Then you could set the viewport on the Panel's ImageView to match the area from the Scene's ImageView.

JimClarke
A: 

Yes I solved the problem with same way.

var bufferedImage = new BufferedImage( scene.width, scene.height, BufferedImage.TYPE_INT_RGB );
scene.renderToImage( bufferedImage );
bufferedImage=bufferedImage.getSubimage(panel.layoutX,panel.layoutY,x,y);

with code above, it is possible to get screenshot and its parts.

Thanks.

cuneyt