[每日一码] ARX实例代码 -- 获取实体的RGB颜色
static COLORREF GetRGBFromEntity( AcDbEntity *ent ){
COLORREF colorRef = RGB(255, 255, 255);
AcCmColor Color = ent->color();
AcCmEntityColor::ColorMethod ColorMethod = Color.colorMethod();
switch(ColorMethod)
{
case AcCmEntityColor::kByACI:
{
long acirgb, r,g,b;
acirgb = AcCmEntityColor::lookUpRGB(Color.colorIndex());
b = ( acirgb & 0xff00L );
g = ( acirgb & 0xff00L ) >> 8;
r = acirgb >> 16;
colorRef = RGB( r, g, b);
break;
}
}
return colorRef;
}
页:
[1]