|
From: Jeff Ciaccio on 26 Jun 2008 15:20 I would like to get the total rgb value, but this does not seem to work. Can anybody help me find the values as integers? playerRGB = (Me.BackColor.Red + Me.BackColor.Green + Me.BackColor.Blue) Thanks -- Jeff Ciaccio Physics and AP Physics Teacher Sprayberry High School; Marietta, GA Blog: http://sprayberry.typepad.com/ciaccio
From: Armin Zingler on 26 Jun 2008 16:26 "Jeff Ciaccio" <noname(a)noreply.org> schrieb > I would like to get the total rgb value, but this does not seem to > work. Can anybody help me find the values as integers? > > playerRGB = (Me.BackColor.Red + Me.BackColor.Green + > Me.BackColor.Blue) "Does not work" is always not very specific. If the compiler does not throw an error, you should enable Option Strict first. If it does, replace Red with R, Green with G and Blue with B. Armin
From: Göran Andersson on 26 Jun 2008 22:27 Jeff Ciaccio wrote: > I would like to get the total rgb value, but this does not seem to work. > Can anybody help me find the values as integers? > > playerRGB = (Me.BackColor.Red + Me.BackColor.Green + Me.BackColor.Blue) > > > Thanks The Red, Green and Blue properties are color constants. You want to use the R, G and B properties to get the color component values. What is it that you are trying to do? Just adding the color component values doesn't seem very useful. Perhaps it's the ToArgb method that you are looking for? -- G�ran Andersson _____ http://www.guffa.com
From: Jeff Ciaccio on 27 Jun 2008 11:13 I do not want to let the user make the screen too dark (because the font color is black), and I think that happens when the sum of R + G + B is a low value, 0 being completely black. I'm not familiar with the ToArgb method - does it do something similar? Thanks! Jeff
From: Göran Andersson on 28 Jun 2008 09:33 Jeff Ciaccio wrote: > I do not want to let the user make the screen too dark (because the font > color is black), and I think that happens when the sum of R + G + B is a > low value, 0 being completely black. I see. What you want is the GetBrightness() method of the Color class. It returns a float value between 0.0 and 1.0. > I'm not familiar with the ToArgb method - does it do something similar? No, it returns the color as an integer value, where the alpha, red, green and blue values are stored sequentially in the bits of the integer. -- G�ran Andersson _____ http://www.guffa.com
|
Pages: 1 Prev: Turning a radio button into a toggle button Next: acrobat distiller |