Convert (Vb6 style) long rgb value to something useful in vb.net
Really, this should be simple...
In VB6, you could represent colors using a long data type for the 64,000+ possible colors.....
So if I have a data item (myMapLine(i).Colour) that holds a line's color using a long between 0 and 64,000, how the heck do I assign that in VB.net?
VB Code:
myPen = New Pen(Color.FromArgb(myMapLine(i).colour), myMapLine(i).thickness)
That doesn't work... nothing appears at all....
Re: Convert (Vb6 style) long rgb value to something useful in vb.net
Quote:
Originally posted by nemaroller
VB Code:
myPen = New Pen(Color.FromArgb(myMapLine(i).colour), myMapLine(i).thickness)
That doesn't work... nothing appears at all....
I struggled with this as well. The problem is the difference between RGB and ARGB, where a is the alpha blending part. Because this is 0 in RGB, the color is completely transparent, so in fact it is invisible.
Try something like this:
VB Code:
myPen = New Pen(Color.FromArgb(myMapLine(i).colour OR &HFF000000), myMapLine(i).thickness)