public Rectangle GetRectangle(int HighlightHeight) { rect = new Rectangle(); rect.X = Math.Min(StartLocation.X, EndLcation.X); rect.Y = Math.Min(StartLocation.Y, EndLcation.Y); rect.Width = Math.Abs(StartLocation.X - EndLcation.X); //rect.Height = Math.Abs(StartLocation.Y - EndLcation.Y); rect.Height = Math.Abs(HighlightHeight); normRect = new NormRect(); normRect.Left = (float)rect.X / (float)Width; normRect.Bottom = (float)rect.Y / (float)Height; normRect.Right = (float)rect.Width / (float)Width; //rect.Height = Math.Abs(StartLocation.Y - EndLcation.Y); normRect.Top = (float)rect.Height / (float)Height; return(rect); }
public void GetRectangles(List <iTextSharp.text.Rectangle> RectangleIText) { rectangles.Clear(); rectangles = new List <Rectangle>(); foreach (var item in RectangleIText) { var rect = new Rectangle(); var nRect = new NormRect(); nRect.Left = (item.Left / pageSize.Right) * this.Width; nRect.Bottom = (1 - (item.Bottom / pageSize.Top) - (item.Height / pageSize.Top)) * this.Height; nRect.Right = ((item.Width / pageSize.Right)) * this.Width; nRect.Top = ((item.Height / pageSize.Top)) * this.Height; rect.X = (int)(nRect.Left); rect.Y = (int)(nRect.Bottom); rect.Width = (int)(nRect.Right); rect.Height = (int)(nRect.Top); rectangles.Add(rect); } }