Yaratish uchun ham foydalaniladi. So‘nggi yillarda kompyuter va uning dasturiy ta‘minotiga bo‘lgan talab va qiziqishlar ortib bormoqda. Bu esa o‘z navbatida dasturchidan katta izlanish va mahoratni talab qiladi


Download 295.63 Kb.
bet15/15
Sana08.01.2022
Hajmi295.63 Kb.
#237053
1   ...   7   8   9   10   11   12   13   14   15
Bog'liq
kurs ishi

}

}



using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApplication48

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}

private void Form1_Load(object sender, EventArgs e)

{

int w, h;

bmp = new Bitmap(500, 500);

g = Graphics.FromImage(bmp);

w = pictureBox1.Width; h = pictureBox1.Height;

Color[] c = new Color[] { Color.Black, Color.Green, Color.Red, Color.Blue, Color.Yellow, Color.Violet, Color.Gray };

float dx = pictureBox1.Height / 14;

float dy = pictureBox1.Width / 14;

for (int i = 0; i < 7; i++)

{

g.DrawRectangle(new Pen(c[i], 3), (i + 1) * dx, (i + 1) * dy, pictureBox1.Width - 2 * (i + 1) * dx, pictureBox1.Height);

g.FillRectangle(new SolidBrush(c[i]), (i + 1) * dx, (i + 1) * dy, pictureBox1.Width - 2 * (i + 1) * dx, pictureBox1.Height);

pictureBox1.Image = bmp;

}

g.Dispose();

}

Graphics g;

Bitmap bmp;

private void button1_Click(object sender, EventArgs e)

{



}

}

}


Download 295.63 Kb.

Do'stlaringiz bilan baham:
1   ...   7   8   9   10   11   12   13   14   15




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling