PictureBox color
Brought to you by:
owenwengerd
My function select color using ACAD_TRUECOLORDLG and show this color using dcl_PictureBox_DrawFillRect.
All work right, but if Green and Blue color components equal zero then dcl_PictureBox_DrawFillRect make incorrect color.
For example, if I select Red Color (RGB = 123, 0,0) as result I see blue color.
Bug example
I tested this in Beta 2 and it worked correctly, displaying a red rectangle. Please test again in the current build and let me know whether you still notice the problem.
Now I install Beta 2 (AutoCAD 2008, Windows XP)
Bag is presented
Can I help you to find this bag?
Please post a simple sample .odcl and .lsp that demonstrate the problem.
I attached example (colortest.ZIP) in my first message. Did you see it?
Sorry, I didn't notice the attachment. What you're seeing is by design. When the argument is less than 255 (as it is in the case you found), OpenDCL interprets it as an AutoCAD color index instead of an RGB color.
I was going to suggest adding 268435456 to the color number so that it isn't interpreted as a color index, but that won't work in beta 2 (it will in beta 3). It looks like the only solution is to return a list instead of a single RGB value. Try changing the last line of the ConvertAcadTrueColorToWindowsColor function to the following:
(list Red Green Blue)
This could also have problems with certain red values causing AutoCAD to interpret the list as DXF codes, as discussed elsewhere. The only foolproof solution is to add 268435456 (0x10000000) to the RGB color, but this won't work until beta 3.