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
 ImageEnVect ObjWidth

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
jccruz Posted - May 28 2015 : 15:51:47
Hello! I have upgraded from ImageEn version 2.2.3 to 5.2.0.

In the version 2.2.3 to get the coordinates from a line like this bar "/" draw from up to down, I used:

x1 := ImageEnVect1.ObjLeft[hobj];
y1 := ImageEnVect1.ObjTop[hobj];
x2 := ImageEnVect1.ObjWidth[hobj] + ImageEnVect1.ObjLeft[hobj];
y2 := ImageEnVect1.ObjHeight[hobj] + ImageEnVect1.ObjTop[hobj];

as an example:
ImageEnVect1.ObjWidth[hobj] = -23
ImageEnVect1.ObjLeft[hobj] = 77
ImageEnVect1.ObjTop[hobj] = 58
ImageEnVect1.ObjHeight[hobj] = 131

Note that ObjWidth is negative and it is right, but when I run the same code using version 5.2.0 the ObjWidth is positive.

Thats wrong?

Thanks
Jose Carlos





JCC
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 21 2015 : 19:30:03
Hi Jose

You can use ImageEnVect.GetObjRect. For objects such as lines, the Rect.Top/Left may exceed Rect.Bottom/Right to indicate the direction of line drawing.

Example
var
  r: TRect;
  hobj: Integer;
  sXDir, sYDir: string;
begin
  if ImageEnVect1.SelObjectsCount > 0 then
  begin
    hobj := ImageEnVect1.SelObjects[ 0 ];
    if ImageEnVect1.ObjKind[ hObj ] <> iekLINE then
      Caption := 'Not a line'
    else
    begin        
      ImageEnVect1.GetObjRect( hobj, r );
      if  r.Top > r.Bottom then
        sYDir := 'Bottom-'
      else
        sYDir := 'Top-';
      if  r.Left > r.Right then
        sXDir := 'Right'
      else
        sXDir := 'Left';
      Caption := 'Line starts at ' + sYDir + sXDir;
    end;
  end;
end;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com