Пример #1
0
		double IZoom.GetZoomAt(RectangularGrid.Location tileLocation)
		{
			var imageBoxLocation = tileLocation.ParentGridLocation;
			IImageBox imageBox;
			if (imageBoxLocation == null)
				imageBox = Context.Viewer.PhysicalWorkspace.SelectedImageBox;
			else
				imageBox = Context.Viewer.PhysicalWorkspace[imageBoxLocation.Row, imageBoxLocation.Column];

			var tile = imageBox[tileLocation.Row, tileLocation.Column];

			//Rather than change the class, we'll just select temporarily.
			var oldSelectedTile = Context.Viewer.SelectedTile;
			tile.Select();

			var transform = GetSelectedImageTransform();
			if (transform == null)
				throw new InvalidOperationException("The tile must contain a valid image.");

			if (oldSelectedTile != null)
				oldSelectedTile.Select();

			return transform.Scale;
		}
Пример #2
0
		IVoiLut ILookupTable.GetLookupTableAt(RectangularGrid.Location tileLocation)
		{
			var voiLutManager = GetSelectedImageVoiLutManager();
			if (voiLutManager == null)
				throw new InvalidOperationException("Selected image can't have a voi lut");

			return voiLutManager.VoiLut;
		}