hi does any one know the RGB values of the standard form in C#.net?

how can i get it to be add to the colour pallatte in the C#.net color pallette?

Recommended Answers

All 9 Replies

Do you mean to the ColorDialog? If so, it has a CustomColors property and the default value of the form background is 15790320.

The Argb values are 255, 240, 240, 240.
The HSB values are 0, 2.980232E-08, 0.9411765

Do you mean to the ColorDialog? If so, it has a CustomColors property and the default value of the form background is 15790320.

The Argb values are 255, 240, 240, 240.
The HSB values are 0, 2.980232E-08, 0.9411765

yes

the Red blue green values
the attach file i need the colour value of the attached file

how can i get
it

Load it as a Bitmap and get the color of any of the pixels.
Something like

Bitmap b = new Bitmap("c:/myfilename.bmp");
Color c = b.GetPixel(0,0);
int[] cc = myColorDialog.CustomColors;
cc[0] = c.ToARGB();
myColorDialog.CustomColors = cc;

Load it as a Bitmap and get the color of any of the pixels.
Something like

Bitmap b = new Bitmap("c:/myfilename.bmp");
Color c = b.GetPixel(0,0);
int[] cc = myColorDialog.CustomColors;
cc[0] = c.ToARGB();
myColorDialog.CustomColors = cc;

where do i load it?

Open your bitmap in Paint.
Pick up the colour with the pipette.
Have a look at the RGB values in the color dialog of the Paint application.

.NET has a set of named colors and I don't think you can change that.
Her is a snippet I made once to chow them all.

Open your bitmap in Paint.
Pick up the colour with the pipette.
Have a look at the RGB values in the color dialog of the Paint application.

.NET has a set of named colors and I don't think you can change that.
Her is a snippet I made once to chow them all.

i want to get the >NET colour and apply into one of the pictures that i have

The BackColor of a form is set to SystemColors.Control.
This is also found in SystemPens.Control and SystemBrushes.Control.
The actual color is dependant upon the windows color scheme or even the users theme.

To put this color on to an image open the image as an Image or Bitmap then draw on the image using a Graphics object for the image. Here is an example of drawing to an image.

private void button4_Click(object sender, EventArgs e)
{
	var test = new Bitmap(100, 100);
	var g = Graphics.FromImage(test);
	g.Clear(Color.White);
	var pen = new Pen(SystemColors.Control, 20);
	g.DrawEllipse(pen, 0, 0, test.Width, test.Height);
	g.FillEllipse(SystemBrushes.ControlDark, 0, 0, test.Width, test.Height);
	this.BackgroundImage = test;
	this.Refresh();
}

I have just recently come across a service which allows you to fill out or edit PDF forms online without having to download any software. I was able to print out my document and even fax it online. Please check this website http://goo.gl/yoGwr2.
I'm sure you will definitely find the service useful and easy to use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.