查看单个帖子
旧 2009-05-04, 05:55 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)