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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 how to calculate the object postion.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
winner Posted - Dec 14 2012 : 17:17:04



4.14 KB

dot 1: left,top is known,
diatance is 5 meter,from dot1 to dot2
zoom=100% 11.8 pixal/meter

when zomm,viewx,viewY change how to calcualte the dot2's postion(top,left)
5   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Dec 16 2012 : 07:43:33
Just pass the index of the object you want to get the left and top values... it does not matter how far away one object is from another... it makes no difference. If you want to get the position of object one pass 0 in hobj. If you want to get the position of object two pass 1 in hobj. There are no calculations possible to get the position.

//Get the position of object number two
ObjLeft1.Caption := 'Left: ' + IntToStr(ImageEnVect1.ObjLeft[1]);
ObjTop1.Caption := 'Top: ' + IntToStr(ImageEnVect1.ObjTop[1]);



William Miller
winner Posted - Dec 16 2012 : 04:19:35
my mean is that the dot1's top and left is known,dot2's top and left is unknown,I want to caculate the dot2's top and left which distance of 5 meters from dot1. when viewx,viewy,zoom changes.
w2m Posted - Dec 15 2012 : 06:42:13
You do not need to calculate anything to get the objects position:
procedure TForm1.ImageEnVect1ObjectMoveResize(Sender: TObject; hobj, Grip: Integer; var OffsetX,
  OffsetY: Integer);
var
  iListItem: TListItem;
begin
  iListItem := ListViewObjects1.Selected;
  if Assigned(iListItem) then
    iListItem.SubItems[1] := (IntToStr(ImageEnVect1.ObjWidth[hobj]) + ' x ' +
      IntToStr(ImageEnVect1.ObjHeight[hobj]));
  ObjLeft1.Caption := 'Left: ' + IntToStr(ImageEnVect1.ObjLeft[hobj]);
  ObjTop1.Caption := 'Top: ' + IntToStr(ImageEnVect1.ObjTop[hobj]);
  ObjWidth1.Caption := 'Width: ' + IntToStr(ImageEnVect1.ObjWidth[hobj]);
  ObjHeight1.Caption := 'Height: ' + IntToStr(ImageEnVect1.ObjHeight[hobj]);
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
winner Posted - Dec 14 2012 : 20:42:54
is circle object
w2m Posted - Dec 14 2012 : 17:59:32
Are the dots ImageEnVect objects?

William Miller