ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
"Colors - Binary Tree Combinations" Program
برنامه ی ترکیب رنگها با درخت دودویی
path 1 = "G:\a\a\L\L\b\g\DS\a\j~m\k\Crt\mm\C#\8X\sln\tp\Clr\CBTC\001 Colors - Binary Tree Combinations"
برنامه ی ترکیب رنگها با درخت دودویی -- Colors - Binary Tree Combinations
لینک فایل های برنامه:
https://s20.picofile.com/file/8443035668/Colors_Binary_Tree_Combinations_14000808.rar.html
لینک مستقیم:
تصاویری از محیط برنامه :
کدهای فایل اصلی برنامه:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace rang
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Color my_color_1;
Color my_color_2;
Color my_color_3;
Color my_color_4;
Color my_color_5;
Color my_color_12;
Color my_color_123;
Color my_color_1234;
Color my_color_12345;
int r, g, b;
int my_share_1;
int my_share_2;
int my_share_3;
int my_share_4;
int my_share_5;
int my_share_12;
int my_share_123;
int my_share_1234;
private void button_Calc_Click(object sender, EventArgs e)
{
// **************************************************** \\
// **************************************************** \\
my_color_1 = panel_Color_1.BackColor;
my_color_2 = panel_Color_2.BackColor;
my_share_1 = (int)numericUpDown_Color_1.Value;
my_share_2 = (int)numericUpDown_Color_2.Value;
r = (my_color_1.R * my_share_1 +
my_color_2.R * my_share_2) /
(my_share_1 + my_share_2);
g = (my_color_1.G * my_share_1 +
my_color_2.G * my_share_2) /
(my_share_1 + my_share_2);
b = (my_color_1.B * my_share_1 +
my_color_2.B * my_share_2) /
(my_share_1 + my_share_2);
my_color_12 = Color.FromArgb(r,g,b);
panel_Color_12.BackColor = my_color_12;
// **************************************************** \\
// **************************************************** \\
my_color_12 = panel_Color_12.BackColor;
my_color_3 = panel_Color_3.BackColor;
my_share_12 = (int)numericUpDown_Color_12.Value;
my_share_3 = (int)numericUpDown_Color_3.Value;
r = (my_color_12.R * my_share_12 +
my_color_3.R * my_share_3) /
(my_share_12 + my_share_3);
g = (my_color_12.G * my_share_12 +
my_color_3.G * my_share_3) /
(my_share_12 + my_share_3);
b = (my_color_12.B * my_share_12 +
my_color_3.B * my_share_3) /
(my_share_12 + my_share_3);
my_color_123 = Color.FromArgb(r, g, b);
panel_Color_123.BackColor = my_color_123;
// **************************************************** \\
// **************************************************** \\
my_color_123 = panel_Color_123.BackColor;
my_color_4 = panel_Color_4.BackColor;
my_share_123 = (int)numericUpDown_Color_123.Value;
my_share_4 = (int)numericUpDown_Color_4.Value;
r = (my_color_123.R * my_share_123 +
my_color_4.R * my_share_4) /
(my_share_123 + my_share_4);
g = (my_color_123.G * my_share_123 +
my_color_4.G * my_share_4) /
(my_share_123 + my_share_4);
b = (my_color_123.B * my_share_123 +
my_color_4.B * my_share_4) /
(my_share_123 + my_share_4);
my_color_1234 = Color.FromArgb(r, g, b);
panel_Color_1234.BackColor = my_color_1234;
// **************************************************** \\
// **************************************************** \\
my_color_1234 = panel_Color_1234.BackColor;
my_color_5 = panel_Color_5.BackColor;
my_share_1234 = (int)numericUpDown_Color_1234.Value;
my_share_5 = (int)numericUpDown_Color_5.Value;
r = (my_color_1234.R * my_share_1234 +
my_color_5.R * my_share_5) /
(my_share_1234 + my_share_5);
g = (my_color_1234.G * my_share_1234 +
my_color_5.G * my_share_5) /
(my_share_1234 + my_share_5);
b = (my_color_1234.B * my_share_1234 +
my_color_5.B * my_share_5) /
(my_share_1234 + my_share_5);
my_color_12345 = Color.FromArgb(r, g, b);
panel_Color_12345.BackColor = my_color_12345;
// **************************************************** \\
// **************************************************** \\
}
private void panel_Color_1_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
panel_Color_1.BackColor = colorDialog1.Color;
}
private void panel_Color_2_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
panel_Color_2.BackColor = colorDialog1.Color;
}
private void panel_Color_3_Click_1(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
panel_Color_3.BackColor = colorDialog1.Color;
}
private void panel_Color_4_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
panel_Color_4.BackColor = colorDialog1.Color;
}
private void panel_Color_5_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
panel_Color_5.BackColor = colorDialog1.Color;
}
private void panel_Color_5_Paint(object sender, PaintEventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}