几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】colors dont match autocad (http://www.dimcax.com/hust/showthread.php?t=15430)

yang686526 2009-05-04 05:55 PM

【转帖】colors dont match autocad
 
colors don't match autocad
colors don't match autocad
i use the following statement to get rgb values to use when drawing objects that have been read from an autocad file:
code:
odcmcolor colorinfo;
// get colorinfo from entity
long lcolor = odcmentitycolor::lookuprgb(colorinfo.colorindex());
when i use the rgb value to draw the objects, i find that the colors do not match the colors in the original autocad drawing. specifically, red and blue are swapped, and so are cyan and yellow. is there a way to get them to match?
thanks,
bob

odcmentitycolor::lookuprgb(colorinfo.colorindex()) is inappropriate function for rendering (it returns color in palette that is used for export to minor versions).
to obtain color for rendering, you should use odgsbasevectorizedevice::getcolor() function. if you don't use our gs devices for rendering, you can obtain rgb from palette, that is returned by function odcmacadpalette(). this function is declared in colormapping.h and has one parameter - background color, since autocad's palette depends on background color. note that autocad have quite sophisticated palette generation mechanism - on any background color any indexed color is visible. dd is worse in this case, it supports only two palettes - for dark and light backgrounds.
sincerely yours,
george udov
last edited by george udov; 11th october 2004 at 04:12 amfff">.
george,
thanks for the information. that solved my problem.
cheers,
bob


所有的时间均为北京时间。 现在的时间是 06:03 PM.