void rasterImageViewer1_PostRender(object sender, ImageViewerRenderEventArgs e) { if (!selectedRect.IsEmpty) { LeadRectD rect = rasterImageViewer1.ImageTransform.TransformRect(selectedRect.ToLeadRectD()); e.PaintEventArgs.Graphics.FillRectangle(brush, new Rectangle((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height)); } }
private LeadRectD BoundsToAnnotations(AnnRectangleObject rectObject, LeadRect rect, AnnContainer container) { // Convert a rectangle from logical (top-left) to annotation object coordinates LeadRectD rc = rect.ToLeadRectD(); rc = _rasterImageViewer.ConvertRect(null, ImageViewerCoordinateType.Image, ImageViewerCoordinateType.Control, rc); rc = container.Mapper.RectToContainerCoordinates(rc); return(rc); }
private LeadRectD BoundsToAnnotations(LeadRect rect) { // Convert a rectangle from logical (top-left) to annotation object coordinates //LeadRectD rc = LeadRectD.Create(rect.Left + System.Convert.ToDouble(rect.Width < 0) * rect.Width, rect.Top + System.Convert.ToDouble(rect.Height < 0) * rect.Height, Math.Abs(rect.Width), Math.Abs(rect.Height)); LeadRectD rc = rect.ToLeadRectD(); rc = masterSheetViewer.ConvertRect(null, ImageViewerCoordinateType.Image, ImageViewerCoordinateType.Control, rc); rc = automation.Container.Mapper.RectToContainerCoordinates(rc); return(rc); }
private Action <EventArgs> OnFocusAction(LeadRect bounds) { return((e) => { if (bounds.IsEmpty) { _selectedSectionBounds = bounds; return; } UpdateCarouselViewState(false); #if __IOS__ if (e.GetType() == typeof(FocusEventArgs)) { _page.ContentLayoutGrid.RowDefinitions[0].Height = new GridLength(PlatformsConstants.PagesHeaderTitleRowHeight, GridUnitType.Absolute); _page.ContentLayoutGrid.RowDefinitions[1].Height = new GridLength(1.3, GridUnitType.Star); _page.ContentLayoutGrid.RowDefinitions[2].Height = new GridLength(1, GridUnitType.Auto); _page.ContentLayoutGrid.RowDefinitions[3].Height = new GridLength(8.7, GridUnitType.Star); } #endif // #if __IOS__ if (_contact.FocusDisabled) { return; } else { // The Entry field has the focus, then resize the main grid rows to make space for the keyboard if (_page.ImageViewer != null) { _imageViewer.Zoom(ControlSizeMode.None, 1.0, _imageViewer.DefaultZoomOrigin); } } _overlay.IsVisible = true; // Save the last selected BC section/field in order to layout the overlay box inside the TransformChanged event of the ImageViewer control _selectedSectionBounds = bounds; if (_page.ImageViewer != null) { LeadMatrix transform = _imageViewer.GetImageTransformWithDpi(true); var boundsD = transform.TransformRect(bounds.ToLeadRectD()); boundsD.Inflate(30, 30); _imageViewer.ZoomToRect(boundsD); } }); }