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 do you enter a polyline manually?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

NotTooSmart

USA
12 Posts

Posted - Jun 30 2021 :  09:33:50  Show Profile  Reply
Hi There,

I have a list of points(x,y) that represent a polyline drawing. How do you enter them manually? Thanks for the help.

Jorge

xequte

39053 Posts

Posted - Jun 30 2021 :  15:45:48  Show Profile  Reply
Hi Jorge

Do you mean like this:

var
  shapePoints: array of TPoint;
begin
  SetLength( shapePoints, 3 );
  shapePoints[0] := Point( 500, 0 );
  shapePoints[1] := Point( 1000, 1000 );
  shapePoints[2] := Point( 0, 1000 );
  TIEPolylineLayer( ImageEnView1.CurrentLayer ).SetPoints( shapePoints, True );
  ImageEnView1.Update();
end;


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

NotTooSmart

USA
12 Posts

Posted - Jun 30 2021 :  19:52:28  Show Profile  Reply
Thanks Nigel,

I created a button and tested your sample code, but I got an error. See picture. How do I correct it?



Jorge
Go to Top of Page

NotTooSmart

USA
12 Posts

Posted - Jun 30 2021 :  20:16:27  Show Profile  Reply
Also, how do I force the polyline created to draw into layer 5 for example?

Jorge
Go to Top of Page

NotTooSmart

USA
12 Posts

Posted - Jul 01 2021 :  13:07:53  Show Profile  Reply
I am finding that this software is not very clear to understand and debug issues. a further definition of the error is shown here. Does anyone knows why am I getting the error? I added a button that calls this program in the Layers Demo:

var
shapePoints: array of TPoint;
begin
SetLength( shapePoints, 3 );
shapePoints[0] := Point( 500, 0 );
shapePoints[1] := Point( 1000, 1000 );
shapePoints[2] := Point( 0, 1000 );
TIEPolylineLayer( ImageEnView1.CurrentLayer ).SetPoints( shapePoints, True );
ImageEnView1.Update();
end;

And here is the error:






Jorge
Go to Top of Page

xequte

39053 Posts

Posted - Jul 01 2021 :  21:27:04  Show Profile  Reply
Hi Jorge

The code assumes you have added a polyline layer.

You should check the layer type like this:


var
  shapePoints: array of TPoint;
begin
  If ImageEnView1.CurrentLayer.Kind <> ielkPolyline then
    Raise Exception.Create( 'Not a polyline' );

  SetLength( shapePoints, 3 );
  shapePoints[0] := Point( 500, 0 );
  shapePoints[1] := Point( 1000, 1000 );
  shapePoints[2] := Point( 0, 1000 );
  TIEPolylineLayer( ImageEnView1.CurrentLayer ).SetPoints( shapePoints, True );
  ImageEnView1.Update();
end;


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

To add a polyline use:

ImageEnView1.LayersAdd( ielkPolyline );

https://www.imageen.com/help/TImageEnView.LayersAdd.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: