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
 PolyLine - Not as expected
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Alan

Australia
10 Posts

Posted - Mar 03 2022 :  02:46:10  Show Profile  Reply
Hi

Continuing my ImageEN education/experiments.

The code below should draw a line the height of the control, centered.
But I only get a line 95px high.

I can set the layer height to the control height. But, then if I make the line point half height way it still has the full height of the control.

Is there a setting I'm missing - I cant seem to make sense of this.

I would like to create a polyline of 4 points so that I can move each of the points independently.

Thanks again

Alan


var
PolyLayer: TIEPolylineLayer;
begin
  ImageEnView1.LayersAdd(ielkPolyline);
   PolyLayer := TIEPolylineLayer(ImageEnView1.CurrentLayer);
   PolyLayer.ClearAllPoints;
   PolyLayer.PolylineClosed:= False;
   PolyLayer.BorderWidth:= 4;
   PolyLayer.BorderColor:= clGreen;
   PolyLayer.AddPoint(1,0);
   PolyLayer.AddPoint(1,ImageEnView1.ClientHeight);
   PolyLayer.PosX:= Round(ImageEnView1.ClientWidth/2);
   PolyLayer.Posy:=0;
  PolyLayer.Update;
end;

xequte

38608 Posts

Posted - Mar 03 2022 :  21:15:24  Show Profile  Reply
Hi Alan

By default, AddPoint() values are a range from 0-1000 (within the width/height of the layer).

Please change the value base to iepbClientArea:

https://www.imageen.com/help/TIEPolylineLayer.AddPoint.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Alan

Australia
10 Posts

Posted - Mar 07 2022 :  02:48:32  Show Profile  Reply
Thanks Nigel

Thant makes sense now.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: