|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ScoOteRLoAdeR
{
public partial class Palet : Form
{
string LastVariable;
public Palet()
{
InitializeComponent();
}
private void Palet_Load(object sender, EventArgs e)
{}
public void OnPaletChanged(string variable)
{
if (LastVariable == variable)
return;
Paramter.Text = variable;
val1.Text = (ScoOteRColorPalet.MIN.ToString("0.0000000"));
val2.Text = ((ScoOteRColorPalet.MIN + (13 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val3.Text = ((ScoOteRColorPalet.MIN + (26 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val4.Text = ((ScoOteRColorPalet.MIN + (39 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val5.Text = ((ScoOteRColorPalet.MIN + (52 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val6.Text = ((ScoOteRColorPalet.MIN + (65 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val7.Text = ((ScoOteRColorPalet.MIN + (78 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val8.Text = ((ScoOteRColorPalet.MIN + (91 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val9.Text = ((ScoOteRColorPalet.MIN + (104 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
val10.Text = ((ScoOteRColorPalet.MIN + (120 * ScoOteRColorPalet.STEP)).ToString("0.00000000"));
//val1.Text = (10 >= val1.Text.Length) ? val1.Text.Remove(val1.Text.Length-1) : val1.Text.Remove(10);
//val2.Text = (10 >= val2.Text.Length) ? val2.Text.Remove(val2.Text.Length-1) : val2.Text.Remove(10);
//val3.Text = (10 >= val3.Text.Length) ? val3.Text.Remove(val3.Text.Length-1) : val3.Text.Remove(10);
//val4.Text = (10 >= val4.Text.Length) ? val4.Text.Remove(val4.Text.Length-1) : val4.Text.Remove(10);
//val5.Text = (10 >= val5.Text.Length) ? val5.Text.Remove(val5.Text.Length-1) : val5.Text.Remove(10);
//val6.Text = (10 >= val6.Text.Length) ? val6.Text.Remove(val6.Text.Length-1) : val6.Text.Remove(10);
//val7.Text = (10 >= val7.Text.Length) ? val7.Text.Remove(val7.Text.Length-1) : val7.Text.Remove(10);
//val8.Text = (10 >= val8.Text.Length) ? val8.Text.Remove(val8.Text.Length-1) : val8.Text.Remove(10);
//val9.Text = (10 >= val9.Text.Length) ? val9.Text.Remove(val9.Text.Length-1) : val9.Text.Remove(10);
//val10.Text = (10 >= val10.Text.Length) ? val10.Text.Remove(val10.Text.Length-1) : val10.Text.Remove(10);
LastVariable = variable;
pictureBox1.Invalidate();
}
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
int height = pictureBox1.Height / 120;
for (int i = 0; i < 120; i++)
{
Rectangle rect = new Rectangle(0, height * i, pictureBox1.Width, height);
SolidBrush b = new SolidBrush(Color.FromArgb( ScoOteRColorPalet.GetColor(ScoOteRColorPalet.MIN + (ScoOteRColorPalet.STEP * i))));
e.Graphics.FillRectangle( b, rect);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Nvidia Registered game developer.
Teaching Assistant,
Faculty of computer and information sciences,
Ain Shams University.
SmartLabZ QT Developer.
Have an experience of more than 2 years in c++(QT/MFC/ATL/Win32),c#, GDI,DirectX