WindowsForms 응용 프로그램을 개발 중이며 그래픽 경로로 정의 된 일부 그림을 강조 표시해야합니다. GraphicsPath를 사용하여 Rectangle.Inflate()에 해당하는 것은 무엇입니까?
using Drawing.Drawing2D
는
Rectangle.Inflate()
에 있지만
GraphicsPath
에 대한 유사한 있습니까?
x와 y에서 같은 값만 팽창하면됩니다.
미리 감사드립니다.
WindowsForms 응용 프로그램을 개발 중이며 그래픽 경로로 정의 된 일부 그림을 강조 표시해야합니다. GraphicsPath를 사용하여 Rectangle.Inflate()에 해당하는 것은 무엇입니까?
using Drawing.Drawing2D
는
Rectangle.Inflate()
에 있지만
GraphicsPath
에 대한 유사한 있습니까?
x와 y에서 같은 값만 팽창하면됩니다.
미리 감사드립니다.
당신의 GraphicsPath
더 큰, 개인적으로는 그래픽 변환을 사용하는 것이 표시하기 :
using (Graphics graphics = /* ... */)
{
var matrix = new Matrix();
matrix.Translate(/* ... */); // put the mid-point of the figure here
matrix.Scale(1.5f, 1.5f); // makes it 50% bigger
matrix.Translate(/* ... */); // put the same mid-point here, but negative
graphics.Transform = matrix;
graphics.FillPath(/* ... */); // or DrawPath
// Use this to reset the transform if you still need the Graphics object
graphics.Transform = new Matrix();
}
글쎄, GraphicsPath.Widen
이 있지만, 정확히 Rectangle.Inflate
과 같지 않습니다.
기본적으로, 지정된 펜을 사용하여 GraphicsPath
의 개요을 그립니다, 그리고 당신에게 이렇게 그려진 영역을 나타내는 GraphicsPath
를 반환합니다.
확대 된 그림을 화면에 그리려면, 먼저 "확장 된"경로 다음에 원래의 "채우기"경로를 모두 그릴 수 있습니다. 당신이 나타내는 그림을 원한다면하지만 다시, 당신은 단지 같은 펜을 사용하여 원래 경로의 윤곽을 그릴 수 ...
덧붙여서 GraphicsPath의 바운딩 직사각형 중간 점을 사용하여 중간 점의 근사를 얻을 수 있습니다. –