/// <summary> /// Метод для отрисовке классической области /// </summary> /// <param name="_currentObject"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="startX"></param> /// <param name="startY"></param> public static void MethodMain(WorkObject _currentObject, float width, float height, float startX = 0, float startY = 0) { float saveStartX = startX; float stepWidth = width / 3; float stepHeight = height / 3; float endX = stepWidth + startX; float endY = stepHeight + startY; int id = 0; for (int stepX = 0; stepX < 3; stepX++) { for (int stepY = 0; stepY < 3; stepY++) { id += 1; RegionRectangle createRegionRectangle = CreateRegionRectangle(id, startX, startY, endX, endY); _currentObject.listRegionRectangle.Add(createRegionRectangle); createRegionRectangle = null; startX += stepWidth; endX += stepWidth; } startX = saveStartX; endX = stepWidth + saveStartX; startY += stepHeight; endY += stepHeight; } }
/// <summary> /// Метод сохранения объектов /// </summary> /// <param name="FiguresList"></param> public void Save(List <ObjectFugure> FiguresList) { ProjectSettingsMain.Zone_NewList.Clear(); foreach (var currentFiguresList in FiguresList) { if (currentFiguresList.Path.PointCount != 0) { RectangleF rectangleF = СonstructionFigure.ShowRectangleFloat(currentFiguresList.Path.PathPoints[0], currentFiguresList.Path.PathPoints[2]); if ((rectangleF.Width < 20) || (rectangleF.Height < 20)) { break; } RegionRectangle regionRectangle = new RegionRectangle { Rectangle = rectangleF, IdObject = currentFiguresList.IdFigure, Visible = true, StartX = currentFiguresList.Path.PathPoints[0].X, StartY = currentFiguresList.Path.PathPoints[0].Y, EndX = currentFiguresList.Path.PathPoints[2].X, EndY = currentFiguresList.Path.PathPoints[2].Y, Width = rectangleF.Width, Height = rectangleF.Height }; ProjectSettingsMain.Zone_NewList.Add(regionRectangle); regionRectangle = null; } } }
public Magnifier(Form form, RegionRectangle regionRectangle, int generationNumber) { _regionRectangle = regionRectangle; magnification = 2.0f * generationNumber; this.form = form ?? throw new ArgumentNullException("form"); this.form.Resize += new EventHandler(form_Resize); this.form.FormClosing += new FormClosingEventHandler(form_FormClosing); timer = new Timer(); timer.Tick += new EventHandler(timer_Tick); initialized = NativeMethods.MagInitialize(); if (initialized) { SetupMagnifier(); timer.Interval = NativeMethods.USER_TIMER_MINIMUM; timer.Enabled = true; } }
/// <summary> /// Метод по созданию новых зон для мыши "Классический" /// </summary> /// <param name="iDObject"></param> /// <param name="startX"></param> /// <param name="startY"></param> /// <param name="endtX"></param> /// <param name="endY"></param> /// <returns></returns> private static RegionRectangle CreateRegionRectangle(int iDObject, float startX, float startY, float endtX, float endY) { var width = endtX - startX; var height = endY - startY; var Rectangle = new RectangleF(startX, startY, width, height); RegionRectangle regionRectangle = new RegionRectangle { Rectangle = new RectangleF(startX, startY, width, height), IdObject = iDObject, Visible = true, StartX = startX, StartY = startY, Width = width, Height = height }; return(regionRectangle); }
public override string ToString() { return($"{RegionName} : {Language} : {{{RegionRectangle.ToString()}}}"); }