Page 1 of 1

ViewXY Selected Rectangle

Posted: Sat Mar 15, 2014 8:09 pm
by juergen
Hi,
Is it possible to select an area like the zoom selection and get the informations about position and size or do I have to do it by hand?

Re: ViewXY Selected Rectangle

Posted: Sun Mar 16, 2014 10:39 am
by ArctionPasi
I'd probably use AnnotationXY for it. It can be set to use screen coordinates or axis values.

For screen coordinates based approach, set:
annot.Style = Rectangle
annot.Anchor.X = 0; //sets anchor to top left
annot.Anchor.Y = 0;
annot.LocationCoordinateSystem = ScreenCoordinates;
annot.LocationScreenCoords.X = mouseX;
annot.LocationScreenCoords.Y = mouseY;
annot.Sizing = ScreenCoordinates
annot.SizeScreenCoords.Width = 100;
annot.SizeScreenCoords.Height = 100;

when you then grab from the edge of the annotation or drag it to other location, SizeScreenCoords and LocationScreenCoords get updated, and you can use that info for further data analysis. You can always convert the screen coordinates into axis values (data values) by using axis.CoordToValue method.

For axis values based approach, take a look at properties
annot.Sizing = AxisValueBoundaries
annot.AxisValuesBoundaries.XMin, XMax, YMin, YMax

:freak:

Re: ViewXY Selected Rectangle

Posted: Mon Mar 17, 2014 3:35 pm
by juergen
It works.

Thank's a lot ...