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
 how to calculate the object postion.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

winner

22 Posts

Posted - Dec 14 2012 :  17:17:04  Show Profile  Reply



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)

w2m

USA
1990 Posts

Posted - Dec 14 2012 :  17:59:32  Show Profile  Reply
Are the dots ImageEnVect objects?

William Miller
Go to Top of Page

winner

22 Posts

Posted - Dec 14 2012 :  20:42:54  Show Profile  Reply
is circle object
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 15 2012 :  06:42:13  Show Profile  Reply
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
Go to Top of Page

winner

22 Posts

Posted - Dec 16 2012 :  04:19:35  Show Profile  Reply
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.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Dec 16 2012 :  07:43:33  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: