private void OnImageViewerImageBoxDrawing(object sender, ImageBoxDrawingEventArgs e) { IImageBox imageBox = this.SliceImageBox; IDisplaySet containingDisplaySet = null; if (_resliceGraphic.ParentPresentationImage != null) { containingDisplaySet = _resliceGraphic.ParentPresentationImage.ParentDisplaySet; } if (containingDisplaySet != null && containingDisplaySet.ImageBox == e.ImageBox) { // translocate the graphic if the user is stacking through the display set that the graphic sits in // do not add this command to history - the stack command generates the actual action command if (_lastTopLeftPresentationImageIndex != e.ImageBox.TopLeftPresentationImageIndex) { _lastTopLeftPresentationImageIndex = e.ImageBox.TopLeftPresentationImageIndex; TranslocateGraphic(_resliceGraphic, e.ImageBox.TopLeftPresentationImage); } } else if (imageBox != null && imageBox == e.ImageBox) { // we're stacking on the set we control, so make sure the colourised display set name is replicated IPresentationImage firstReslicedImage = imageBox.TopLeftPresentationImage; ColorizeDisplaySetDescription(firstReslicedImage, this.NormalColor); // and realign the slice line with the stacked position if (_resliceGraphic.ParentPresentationImage != null && _resliceGraphic.ParentPresentationImage != firstReslicedImage) { _resliceGraphic.SetLine(imageBox.TopLeftPresentationImage, _resliceGraphic.ParentPresentationImage); _resliceGraphic.Draw(); } } }
private void OnImageBoxDrawing(object sender, ImageBoxDrawingEventArgs e) { UpdateEnabled(); }
private void OnImageViewerImageBoxDrawing(object sender, ImageBoxDrawingEventArgs e) { IImageBox imageBox = this.SliceImageBox; IDisplaySet containingDisplaySet = null; if (_resliceGraphic.ParentPresentationImage != null) containingDisplaySet = _resliceGraphic.ParentPresentationImage.ParentDisplaySet; if (containingDisplaySet != null && containingDisplaySet.ImageBox == e.ImageBox) { // translocate the graphic if the user is stacking through the display set that the graphic sits in // do not add this command to history - the stack command generates the actual action command if (_lastTopLeftPresentationImageIndex != e.ImageBox.TopLeftPresentationImageIndex) { _lastTopLeftPresentationImageIndex = e.ImageBox.TopLeftPresentationImageIndex; TranslocateGraphic(_resliceGraphic, e.ImageBox.TopLeftPresentationImage); } } else if (imageBox != null && imageBox == e.ImageBox) { // we're stacking on the set we control, so make sure the colourised display set name is replicated IPresentationImage firstReslicedImage = imageBox.TopLeftPresentationImage; ColorizeDisplaySetDescription(firstReslicedImage, this.NormalColor); // and realign the slice line with the stacked position if (_resliceGraphic.ParentPresentationImage != null && _resliceGraphic.ParentPresentationImage != firstReslicedImage) { _resliceGraphic.SetLine(imageBox.TopLeftPresentationImage, _resliceGraphic.ParentPresentationImage); _resliceGraphic.Draw(); } } }