Hi all,
Simple question.
I create a polygon using the axMapPro1.Cad.Polygon() method. One of the options is to specify a color. Again, the manual is a little weak on the docs so I thought I would check here. Using VS 2010 and C#
If I set the brush mode = Color.FromArgb(0, 255, 0, 0).ToArgb(), I would expect to see the color in red (since I am using ARGB, the first value is the alpha value).
Just to make sure I am not getting confused in my old age, I also assign the same value to a label (which I can click on to show/hide the polygon).
The code to assign the color is simply:
tpg1.Brush.Color = Color.FromArgb(0, 255, 0, 0).ToArgb();
and the label is:
this.label1.ForeColor = Color.FromArgb(tpg1.Brush.Color);
Where tpg1 is defined as:
MapPro80.CadObj tpg1 ;
I have commented out the code to set the brush.mode, brush.style, and pen.ROP
The pen settings (which I thought were just to paint the outline) are:
tpg1.Pen.Color = Color.FromArgb(0, 255, 255, 255).ToArgb(); // black
tpg1.Pen.Width = 1;
Given all that, I would expect the polygon to render in red. The label is red. But the polygon is colored blue.
At first I thought it was that the conversion from/to argb was the culpret (it still might be). But that is why I used the color in the control to set the color of the label.
I know I can "using System.Visualbasic.xxx" and then use the VB RGB method, but I kinda thought that I could do this in C# without calling in VB. Of course, I can always write my own RGB method (heck its just a 3 byte value) as well, but I haven't had to write code to do things like that for a decade or two. Now back in the 80s....
Any ideas on what I am missing?
Thanks,
me
When I run the app



