Outside of viewbox

Is there a ways to know if a control is in or out of the current viewbox?

I made a test with a grid (inside the zoom panel) that contains 100 x 100 rectangles. I want to change the colors of the rectangles which are inside or outside of the viewbox. In my example the ViewBox.Contains(Point) method never returns true.

public void UpdateViewbox(Ab2d.Controls.ZoomPanel panel)
foreach (Rectangle item in MyGrid.Children)
Point point = item.TranslatePoint(new Point(0,0), this);
if (panel.Viewbox.Contains(point))
item.Fill = Brushes.Red;
item.Fill = Brushes.Blue;

Is there an example of how to do that?

Messages In This Thread
Outside of viewbox - by Björn - 02-17-2016, 12:53 PM
RE: Outside of viewbox - by abenedik - 02-17-2016, 10:46 PM
RE: Outside of viewbox - by Björn - 02-22-2016, 02:19 PM

Forum Jump:

Users browsing this thread:
1 Guest(s)