public override void Layout() { if (_bottomRightPoint != null && _archLeftPoint != null) { double pixelSpacing = (double)(_bottomRightPoint.Y - _archLeftPoint.Y) / (double)_linePixelCount; for (int i = 0; i < _linePixelCount; i++) { PreviewPixel pixel = _pixels[i]; pixel.X = _topLeftPoint.X; pixel.Y = _bottomRightPoint.Y - (int)(i * pixelSpacing); ; } int arcWidth = _bottomRightPoint.X - _topLeftPoint.X; int arcHeight = _archLeftPoint.Y - _topLeftPoint.Y; List <Point> points = PreviewTools.GetArcPoints(arcWidth, arcHeight, _archPixelCount); for (int i = 0; i < points.Count; i++) { PreviewPixel pixel = _pixels[i + _linePixelCount]; pixel.X = points[i].X + _topLeftPoint.X; pixel.Y = points[i].Y + _topLeftPoint.Y; } SetPixelZoom(); } }
public override void Layout() { if (BottomRight != null && TopLeft != null) { int width = BottomRight.X - TopLeft.X; int height = BottomRight.Y - TopLeft.Y; List <Point> points; points = PreviewTools.GetArcPoints(width, height, PixelCount); int pointNum = 0; foreach (PreviewPixel pixel in _pixels) { pixel.X = points[pointNum].X + TopLeft.X; pixel.Y = points[pointNum].Y + TopLeft.Y; pointNum++; } SetPixelZoom(); } }
public override void Layout() { int width = _bottomRight.X - _topLeft.X; int height = _bottomRight.Y - _topLeft.Y; List <Point> points; points = PreviewTools.GetArcPoints(width, height, PixelCount); //points = PreviewTools.GetEllipsePoints(0, 0, width/2, height/2, PixelCount*2, 180); int pointNum = 0; foreach (PreviewPixel pixel in _pixels) { //if (pointNum < points.Count) //{ pixel.X = points[pointNum].X + _topLeft.X; pixel.Y = points[pointNum].Y + _topLeft.Y; pointNum++; //} } }