|
-
Oct 10th, 2002, 04:23 PM
#1
Thread Starter
Hyperactive Member
RGB saved colours thing ?
hi, i have a RGB colour thing with 3 slider bars and you can make different colours, is there a way to save a colour you like, give it a name then have a menu that has a submenu whith the saved colours in ?
please help
thanks
-
Oct 10th, 2002, 05:55 PM
#2
Software Eng.
You have 2 options.
1) Save it in the registry
2) Save it in a text file
To save a textfile.
Code:
'r,g,b= the red, green, and blue values
Open "Myfile" for append as #1
print #1,r & "," & g & "," & b
close #1
-
Oct 10th, 2002, 06:01 PM
#3
Software Eng.
See this link for information on saving to the registry.
-
Oct 11th, 2002, 06:00 AM
#4
Thread Starter
Hyperactive Member
ok, but how can they give the colour a name then, in a menu the colour names appear ?
-
Oct 11th, 2002, 07:22 AM
#5
Private Sub cmdSaveColor_Click()
Dim FileNum As Integer
FileNum = FreeFile
Open "C:\rgb.color" For Output As FileNum
Write #FileNum, HScroll1.Value
Write #FileNum, HScroll2.Value
Write #FileNum, HScroll3.Value
Close #FIleNum
End Sub
Private Sub cmdOpenColor_Click()
Open "C:\rgb.color" For Binary Access Read As #1
Input #1, r
Input #1, g
Input #1, b
Close #1
HScroll1.Value = r
HScroll2.Value = g
HScroll3.Value = b
Me.BackColor = RGB(r, g, b)
End Sub
That worked for me. It is also the same way i save line co-ordinates for drawings to make your own file types.
Hope that helped
Last edited by «°°phReAk°°»; Oct 11th, 2002 at 07:25 AM.
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 14th, 2002, 09:35 PM
#6
Software Eng.
Originally posted by richsmith
ok, but how can they give the colour a name then, in a menu the colour names appear ?
Shouldn't be too hard. You can even create a UDT for it e.g.
Code:
Private Type tColor
sName As String
Red As Integer
Green As Integer
Blue As Integer
End Type
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|