Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Drawing;
- using System.Windows.Forms;
- namespace WindowsFormsApp27
- {
- public class Rectangle
- {
- int x, y;
- int width, height; // shir an dvisota
- Color lineColor, fillColor;
- public Rectangle(int x, int y, int width, int height, Color lineColor, Color fillColor)
- {
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- if (width < 0)
- { this.width = width * -1; }
- if (height < 0)
- { this.height = height * -1; }
- this.lineColor = lineColor;
- this.fillColor = fillColor;
- }
- public void Draw(Graphics g)
- {
- g.FillRectangle(new SolidBrush(fillColor), x, y, width, height);
- g.DrawRectangle(new Pen(lineColor), x, y, width, height);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement