need to get a colorref color from an entity
need to get a colorref color from an entity
hi evrybody
is someone know how to get a colorref object from oddbentityptr.
thanks in advance
a.gaamouz
oddbentity has colorindex() method. it returns index in active palette. autocad uses different palettes for light and dark backgrounds. for example color "7" may be black or white depending on background color. dwg file does not contain background color or rgb colors.
one more thing: color index may have 2 special values byblock & bylayer which should be handled specially. for example:
an entity with byblock color is inside a block.
block is inserted twice. one block reference has color "1" and second block reference has color "2".
entity will be rendered with different colors depending on what block reference is being rendered.
sergey slezkin
hi my friend....how are you today...
i have some problems to realize what you mean sergei....could you please draft me a portion of code. i would like to read colors from entity and draw them using gdi colorref...you will save me....
thanks in advance
are you developing a windows viewer yourself? it's non-trivial task. rendering support will be available from oda soon as c++ api and as activex control. together with implementations via gdi and opengl. currently odamfcapp sample is able to render drawings but it is not finished.
converting dwg to bmp and dwf will be available soon too.
sergey slezkin
hi sergey
yes i developed a windows graphic engine with only gdi object...i have all the cad classes written with c++. we develop classes to convert acad object to our own cad object but still have some little problems. i think we will switch to opengl in the future.....if you have some code it could help please feel free to send it to me...
my email :
aziz.gaamouz@sophiaconcept.ma
color index is an index in color table. acadpalette.h from include folder (dwgdirect 1.05 posted yesterday) can be used to instantiate both palettes.
but byblock and bylayer colors (0 and 256) must be handled specially.
odamfcapp sample contains the code you are asking for.
note that rendering functionality is not shipped yet and c++ interfaces concerning rendering may be changed.
sergey slezkin