Greetings All,
here is a smal example to draw two vectorial boxes
The question is, how do I get the first box to the top?
procedure TForm1.Button1Click(Sender: TObject);
var LayerUp, LayerDown, h1, h2:integer;
ObjectRect:TRect;
begin
ImageEnVect1.LayersSync := true;
//Create a blue box
LayerDown := ImageEnVect1.LayersAdd;
h1 := ImageEnVect1.AddNewObject;
ObjectRect := Rect(10,10,110,110);
ImageEnVect1.ObjKind[h1] := iekBOX;
ImageEnVect1.SetObjRect(h1, ObjectRect);
ImageEnVect1.ObjPenStyle[h1] := psClear;
ImageEnVect1.ObjBrushStyle[h1] := bsSolid;
ImageEnVect1.ObjGraphicRender := true;
ImageEnVect1.ObjTransparency[h1] := 255;
ImageEnVect1.ObjBrushColor[h1] := clBlue;
ImageEnVect1.ObjStyle[h1]:=[ievsVisible];
ImageEnVect1.ObjGripPen.Style := psClear;
ImageEnVect1.ObjGripBrush.Style := bsclear;
//Create a red box over the blue box
LayerUp := ImageEnVect1.LayersAdd;
h2 := ImageEnVect1.AddNewObject;
ObjectRect := Rect(20,20,120,120);
ImageEnVect1.ObjKind[h2] := iekBOX;
ImageEnVect1.SetObjRect(h2, ObjectRect);
ImageEnVect1.ObjPenStyle[h2] := psClear;
ImageEnVect1.ObjBrushStyle[h2] := bsSolid;
ImageEnVect1.ObjGraphicRender := true;
ImageEnVect1.ObjTransparency[h2] := 255;
ImageEnVect1.ObjBrushColor[h2] := clRed;
ImageEnVect1.ObjStyle[h2]:=[ievsVisible];
ImageEnVect1.ObjGripPen.Style := psClear;
ImageEnVect1.ObjGripBrush.Style := bsclear;
//to try invisible the LayerUp, but does not work
ImageEnVect1.Layers[ LayerUp ].Visible := false;
//to try brind to front the blue box, but does not work
ImageEnVect1.LayersMove(LayerUp, LayerDown);
end;
What am I doing wrong?
Regards,
Kostas