SolidBrush, coloring graphics gives unexpected result

  • Thread starter Thread starter Morten Snedker
  • Start date Start date
M

Morten Snedker

I have an Access application where my forms have to different colors.
These I wish to use in my vb.net app as well.

I copy screen and paste into Photoshop and use the color picker to get
the color. It returns RGB 58,110,165.

That makes me come up with:
Dim myBrush As New SolidBrush(Color.FromArgb(100, 58, 110, 165))

I set Alpha to 100 - but don't know if this is correct. However, I
don't get the same color in the two applications. How come?


Regards /snedker
 
Hi Morten,

try this:
Dim br As New SolidBrush(Color.FromArgb(58, 110, 165))

hth Peter
 
Morten Snedker said:
I have an Access application where my forms have to different colors.
These I wish to use in my vb.net app as well.

I copy screen and paste into Photoshop and use the color picker to get
the color. It returns RGB 58,110,165.

That makes me come up with:
Dim myBrush As New SolidBrush(Color.FromArgb(100, 58, 110, 165))

I set Alpha to 100 - but don't know if this is correct. However, I
don't get the same color in the two applications. How come?

Set Alpha to 255 or use another overload of 'FromArgb' that doesn't expect
an alpha value and will create an opaque color automatically.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top