![]() |
【转帖】error with colors
error with colors
error with colors does somebody tell me what's the problem with this code? odcmcolor col; col.setcolormethod( odcmentitycolor::kbylayer ); col.setcolor( mystructure.color().rgb() ); i'm trying to export my own structures to dwg/dxf files. but the program has a runtime error in the setcolor operation. i don't know why. could somebody help me? thanks in advance. what type and value does your mystructure.color().rgb() return? sergey slezkin sorry, i've forgotten to put this information. the operation rgb() returns an unsigned int. 1. if the int is 32-bit setcolor() expects higher byte representing colormethod and the rest 3 bytes - rgb or index depending on the color method. some combinations are invalid. for example color method kbyaci (autocad color index) and index value > 256. 2. setcolor() sets color method too so previous line is senseless. 3. if color method is kbylayer rgb can't be specified. to set rgb value use setrgb(). but this function will set color method to kbycolor. sergey slezkin |
所有的时间均为北京时间。 现在的时间是 04:40 AM. |