Getting RGB values from ColorDialog() / saving
-
Thursday, October 15, 2009 11:30 PMAlright, thanks so much for helping me in the past, and yet again I am stumped!
Ive got myself setup like so:
Windows form
+Picture box (just for displaying the color)
++ColorDialog1
+++backgroundWorker1
and i have my code setup like this:
Click on picture box->opens dialog & runs backgroundWorker1
+backgroundWorker1 waits until the dialog closes, and sets the background color of the picture box to the color selected in the dialog.
now, what I want to do is save the values to a .ini file in this format:
[Color]
Red=x
Green=x
Blue=x
using WritePrivateProfileInt(...);
so i can read then in another application (already setup)
Ive been looking at the subs of colorDialog1 but i havent found anything similar to.. "Value" or anything like that.
Any help is greatly appriciated.
-CME
EDIT: on a side note, using this:
String^ COLORTEST = colorDialog1->Color.ToString();
label12->Text = COLORTEST;
the label then reads: Color[A=255 R=255 G=255 B=255 ]
(those are the correct values) but other then that i have not made any progress
All Replies
-
Friday, October 16, 2009 12:59 AM
Solution:
String^ COLORTEST = colorDialog1->Color.R.ToString();
- Marked As Answer by nobugzMVP, Moderator Friday, October 16, 2009 1:08 AM
-
Friday, October 16, 2009 1:07 AMHowever, now I need to be able to convert a String^ to an Int, to save it in my .ini file

