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
 Marker Demo

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
John Posted - Oct 19 2011 : 05:35:17
Fabrizio

a) The Marker demo illustrates how to create "markers" with MouseInteractVt := [miPutLineLabel];. Is it possible to select a iekLineLabel object and determine the pixel location of the "marker" created with a iekLineLabel object?

b) If a) is possible, is there a function to enter the pixel location of two iekLineLabel objects and determine the distance in pixels between the two "markers"?

TIA

John

5   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Oct 20 2011 : 23:04:04
The center of an object is just the top and left plus the half of the width and height, so you can use every object as a marker.

quote:
Am I missing something or is this beyond the current program capabilities? If the latter, would you consider adding this functionality for the forthcoming 4.0.2 release?


Maybe, but you can obtain the same effect (distance of two markers, if I understood well) with a little effort.
John Posted - Oct 20 2011 : 18:14:08
Fabrizio

Whether I use miPutLine label as previously discussed, a miPutBitMap and use a small circle or even miPutEllipse (as in the Spot demo), I need to be able to clearly define the x and y coordinates of two different objects for the purposes previously stated. I do not see a mechanism to accomplish this with any of the three mentioned choices. Using either an identifiable end of a miPutLine or the center of an iePutEllipse would be ideal.

Am I missing something or is this beyond the current program capabilities? If the latter, would you consider adding this functionality for the forthcoming 4.0.2 release?

I appreciate your efforts and anticipate your reply.

John
fab Posted - Oct 20 2011 : 12:55:49
quote:
Given the flexability in positioning the "Label" end of the iekLineLabel object around the "Marker" end, how do I determine which end of the iekLineLabel (left or right) contains the label and which end of the iekLineLabel represents the "Marker"?


Actually the linelabel was not designed for this purpose, in fact it is a line, not a marker.
Instead you could put an image as marker, using iekBITMAP.
John Posted - Oct 20 2011 : 11:58:15
Fabrizio

The Label end of the iekLineLabel can be positioned 360 degrees around the "non-label" or "Marker" position of the iekLineLabel object. Because of this, my concern is how to determining the absolute x and y positions of the "Marker" location.

With GetObjRect I can define the x and y coordinates for each end of a selected iekLineLabel object. (see below) However, I need to determine the distance between to separate "Markers" on two separate iekLineLabel objects. As a result, the "Marker" position (non-labeled end) of each iekLineLabel object must be able to be defined so that the correct x and y coordinates are used to calculate the distance between the two selected "Markers".

Given the flexability in positioning the "Label" end of the iekLineLabel object around the "Marker" end, how do I determine which end of the iekLineLabel (left or right) contains the label and which end of the iekLineLabel represents the "Marker"?

var
tempObjIndex: Integer;
tempRect: TRect;
tempLeft_x: Integer;
tempLeft_y: Integer;
tempRight_x: Integer;
tempRight_y: Integer;

begin
ImageEnVect1.GetObjRect(ImageEnVect1.SelObjects[tempObjIndex], tempRect);
tempLeft_x := tempRect.TopLeft.x;
tempLeft_y := tempRect.TopLeft.y;
tempRight_x := tempRect.BottomRight.x;
tempRight_y := tempRect.BottomRight.y;
end;


TIA

John


fab Posted - Oct 20 2011 : 00:22:55
quote:
a) The Marker demo illustrates how to create "markers" with MouseInteractVt := [miPutLineLabel];. Is it possible to select a iekLineLabel object and determine the pixel location of the "marker" created with a iekLineLabel object?


It is possible to know the initial and ending coordinates of the line. Look at GetObjRect method.

quote:
b) If a) is possible, is there a function to enter the pixel location of two iekLineLabel objects and determine the distance in pixels between the two "markers"?


You have to calculate the distance manually.
Given the coordinates of the two objects you can calculate the distance with:


function GetTwoObjDistance(ie:TImageEnVect; hobj1, hobj2: integer): double;
var
  lx, ly: double;
  r1, r2:TRect;
begin
  ie.GetObjRect(hobj1, r1);
  ie.GetObjRect(hobj2, r2);
  lx := abs(r1.Left-r2.Left) * ie.MeasureCoefX;
  ly := abs(r1.Top-r2.Top) * ie.MeasureCoefY;
  result := sqrt(lx * lx + ly * ly);
end;


This sample code assumes that Left/Right and Top/Bottom coordinates coincide.