高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】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
|