Re: questions on rgb/argb
1) The two are seriously different. If you just compare 0,0,127 to 0,0,255, you will see that both are blue, but of much different shade. Changing the alpha level should just alter how much of the background color bleeds through whichever shade you are setting. With that error, you might as well leave off the A value.
2) The two are not EXACTLY equal. In fact, I would expect that you can see the difference, though it will not be strong. As for the overall question, I think you have to consider what your true objective is. If you need the color to return a certain value, then you might be better off just dropping the alpha channel for the conversion (act as if alpha was always just 255). If you need it to look a certain way, remember all those optical illusions where a colored stripe looks different when placed against a different colored background, and realize that perception is going to be faulty no matter what you do, so there may be no 'right' answer.
Re: questions on rgb/argb
hmm alrite thanks for the tip anyways is argb even frequently used for?
1 Attachment(s)
Re: questions on rgb/argb
Quote:
Originally Posted by
pacerier
hmm alrite thanks for the tip anyways is argb even frequently used for?
Setting a transparent BackColor works to some extent for controls but not for forms (Form.AllowTransparency is just a swindle). For example, I made the transparent blue label shown below like this:
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.BackColor = Color.FromArgb(127, 0, 0, 255)
End Sub
ARGB colours are really useful when you are painting with Graphics (e.g. in a Paint event sub), because that supports transparency properly. You can get all kinds of nice effects with transparent pens, brushes and gradients.
About your question 3. You could change the A value of a colour without changing the RGB settings like this:
Code:
Dim clr As Color = Color.Violet
Dim transparentViolet As Color = Color.FromArgb(127, clr.R, clr.G, clr.B)
bye, BB