Я пытаюсь нарисовать прямоугольник со свойством, определенным в другом классе.
У меня вопрос, как мне нарисовать это в картинке в main / form1.cs.
Я довольно борюсь с ООП в C #.
Пожалуйста, помогите мне.
Класс формы:
public Layer DrawRectangle(Layer.Type RectangleType, int Width, int Height, int StrokeThickness, int CornerRadius)
{
this.draw.pboxGraphics.Clear(Color.White);
float width = (Width * this.draw.value) - StrokeThickness;
float height = (Height * this.draw.value) - StrokeThickness;
float x = (this.draw.centerPoint.X - (width / 2f)) - 0.5f;
this.layerSize = new SizeF(width, height);
this.layerLocation = new PointF(x, ((this.draw.centerPoint.Y - (height / 2f)) - 0.5f) + this.draw.offset);
Pen pen = new Pen(Brushes.Red) {Width = StrokeThickness};
RectangleF rect = new RectangleF(this.layerLocation, this.layerSize);
this.draw.pboxGraphics.SmoothingMode = SmoothingMode.AntiAlias;
return new Layer(RectangleType, this.layerSize, new PointF(this.layerLocation.X, this.layerLocation.Y - this.draw.offset), Width, Height, this.activeWidth, this.activeHeight, StrokeThickness,bothScale,widthScale, heightScale,widthScaleRatio,heightScaleRatio);
}