Home Tour! Products Download Purchase Support Company Contacts  

Question

One Programmer asked

In the TreeControl I am finding that Icons and Bitmaps with an area painted grey is being painted as white why?

Another Programmer asked

In my code I have tried different numbers for the image index for a TreeControl, but it seams like it is always putting the same one.

In AutoCAD the images are always the same:
Tree control in AutoCAD.

But in the ObjectDCL editor, the images are all different:
Tree images in editor.

My code (below) is writen so that each child of a tree item has a different image.

(Odcl_Tree_AddParent "LayExp" "DclLayExp" "TreeLay" CADFXDISC "Disc" 2 2 2)
(Odcl_Tree_AddParent "LayExp" "DclLayExp" "TreeLay" CADFXDISC "Disc" 1 1 1)
(Odcl_Tree_AddParent "LayExp" "DclLayExp" "TreeLay" CADFXDISC "Disc" 0 0 0)

Why is the Tree Control showing all my images as the same?

Answer

What is happening is that Microsoft's CImageList C++ object that has to be used to manage Icon and Bitmap images in a TreeControl is transforming all the grey pixels (Reg, 192, Green 192, Blue 192) into transparent pixels. It does this by default and it cannot be changed or modified. I would suggest editing the Icons or Bitmaps so that you use a different color than grey. I have seen other programs using similar Icons colored with yellow instead to work around this problem.

Home Products Download Purchase Support Company Contacts