ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ObjLayer question
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

spetric

Croatia
308 Posts

Posted - Nov 23 2015 :  13:09:33  Show Profile  Reply
I'm trying to put anchor an object to layer using
ObjAnchorToLayers = true and ObjLayer[hobj] = layer_index.

However, object is not drawn relative to layer's position.
Do I need to adjust object's Left and Top values using layer's PosX and PosY or I'm missing something?

Also, when layer is moved, object(s) anchored to layer is not moved.

TIA,
Siniša

w2m

USA
1990 Posts

Posted - Nov 23 2015 :  13:55:30  Show Profile  Reply
If the objects are correctly anchored to a layer then you should not have to do anything. The objects position is relative to the layer and the object can not be dragged off the layer. When the layer is moved, all objects in the layer are moved with the layer. I have a project that does this correctly which you are welcome to. If you want it email me.

procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnVect1.IO.Params.BMP_HandleTransparency := True;
  ImageEnVect1.Gestures.Pan.Enabled := True;
  ImageEnVect1.Gestures.Zoom.Enabled := True;
  ImageEnVect1.DisplayGrid := Grid1.Checked;
  ImageEnVect1.DisplayGridLyr := 0;
  ImageEnVect1.LayersSync := True;
  ImageEnVect1.Proc.AutoUndo := False;
  ImageEnVect1.Proc.UndoLimit := 99;
  ImageEnVect1.ForceALTkey := True;
  ImageEnVect1.ObjAnchorToLayers := True;
  ImageEnVect1.ObjBitmapHandleTransparencyOnSel := True;
  ImageEnVect1.ObjBoxInnerSelectable := True;
  ImageEnVect1.MaxSelectionDistance := 15;
end;

procedure TForm1.ImageEnVect1NewObject(Sender: TObject; hobj: Integer);
begin
  ImageEnVect1.ObjLayer[hobj] := ImageEnVect1.LayersCurrent;
  ImageEnVect1.MouseInteract := [];
  ImageEnVect1.MouseInteractVt := [miObjectSelect];
end;


I hope this helps.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Nov 23 2015 :  14:09:29  Show Profile  Reply
Thanks Bill,

I've found ObjAnchorToLayers set to false in one of my class constructor, overriding default setting (true).

Thanks a lot,
Siniša
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: