I have a problem with mixing images (from DXImagelist) with shapes (rectangles, ellipses).
Drawing a shape prevents images being drawn
ie if the processing sequence is image1, rectangle, ellipse, image2 then image1 is drawn OK as are the rectangle and ellipse but image2 is not drawn. If I process all the images first in a separate loop followed by a loop for shapes then all images and shapes are drawn OK. However this means that where overlaps occur images are always obscured by shapes. I need the user to determine the sequence of drawing and thus to control which objects are drawn on top.

The code I have used is:
[pascal]DXDraw1.Surface.Fill( clGreen );
with DXDraw1.Surface.Canvas do
begin
for obj_ptr:=0 to obj_count - 1 do
begin
dxdraw1.surface.canvas.Brush.color:=my_objects_col or[obj_ptr];
dxdraw1.surface.canvas.brush.style:=bssolid;
case my_objects[obj_ptr] of
1: rectangle(my_objects_x1[obj_ptr],my_objects_y1[obj_ptr],
my_objects_x1[obj_ptr] + my_objects_x2[obj_ptr],
my_objects_y1[obj_ptr] + my_objects_y2[obj_ptr]);
2: ellipse(my_objects_x1[obj_ptr],my_objects_y1[obj_ptr],
my_objects_x1[obj_ptr] + my_objects_x2[obj_ptr],
my_objects_y1[obj_ptr] + my_objects_y2[obj_ptr]);
4: dximagelist1.Items[my_objects_image[obj_ptr]].draw(DXDraw1.Surface,
my_objects_x1[obj_ptr],my_objects_y1[obj_ptr],0);
end; // end case
end; // end loop thru objects
dxdraw1.surface.canvas.Release;
end; // end with canvas

DXdraw1.Flip;[/pascal]

I hope that I have explained the problem adequately and that someone can suggest a solution to the problem (the object of the program is garden design and I anticipate a maximum of 200 objects to be drawn). I'm using Windows98, Delphi Personal 6 and DelphiX 2000.07.17.

[Edit by Useless Hacker - added pascal tags]