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 get SelPoints of....?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Nov 23 2018 :  05:23:11  Show Profile  Reply
Hello,

I am using following code to select the content of a layer:

if ImageEnViewMain.LayersCurrent > 0 then
   ImageEnViewMain.SelectNonAlpha();

This will create a selection around the content of selection.

Now I want to retrieve the selection points so I am trying to use following code:

for I := 0 to ImageEnViewMain.PolySelCount - 1 do
begin
    MyPolySelArray[ I ] := ImageEnViewMain.PolySel;
end;

But ImageEnViewMain.PolySelCount always comes up as Zero!

So how can we get the point of selection created using [i]SelectNonAlpha
?

TIA


Yogi Yang

yogiyang

India
727 Posts

Posted - Nov 27 2018 :  23:23:16  Show Profile  Reply
Hello Nigel,

 
3. Polyline layers can be created from a selection

Now that there is a feature to create Polyline from selection in 8.1.2, there should be some way to get array of selection points.

Can you please help solve this quickly.

TIA


Yogi Yang
Go to Top of Page

xequte

38616 Posts

Posted - Nov 30 2018 :  20:10:13  Show Profile  Reply
Hi Yogi

Because of the way SelectNonAlpha() works, it produces a non-vectorial selection (i.e. a selection represented by a bitmap, rather than a path of vertices).

It is rarely practical to convert a bitmap into a vector.

To determine which pixels are selected, you can use IsPointInsideSelection, e.g.

procedure TForm1.ImageEnView1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
  if ImageEnView1.IsPointInsideSelection(X, Y) then
    memo1.Lines.add(format('%d %d is selected', [X, Y]));
end; 


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