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
 Layer from selection with soft edge

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
klausdoege Posted - Nov 07 2013 : 12:20:56
Hello,
i have 2 procedures,
and I would like to generate a layer as ellipse with soft edge.

procedure TMainForm.SelectEllipseClick(Sender: TObject);
begin
ImageEnView1.MouseInteract:=[miselectcircle];
ImageEnView1.SelectionMaskDepth := 8;
end;

procedure TMainForm.AddLayerfromSelectionClick(Sender: TObject);
begin
if ImageEnView1.Selected then
begin
ImageEnView1.MakeSelectionFeather(10);
ImageEnView1.LayersCreateFromSelection;
ImageEnView1.MouseInteract:=[miResizeLayers,miMoveLayers];
ImageEnView1.DeSelect;
end;
end;

after
procedure TMainForm.SelectEllipseClick(Sender: TObject);
I see the selection this is OK

119.17 KB

now i click
procedure TMainForm.AddLayerfromSelectionClick(Sender: TObject);
and i see a layer but he is not a ellipse, why ???
What make i wrong.

115.66 KB

Klaus
www.klausdoege.de
6   L A T E S T    R E P L I E S    (Newest First)
klausdoege Posted - Nov 18 2013 : 02:38:40
Hello,

I have now found a solution.
If following call, takes place previously, all great works out.

procedure TMainForm.AddLayerfromSelectionClick(Sender: TObject);
begin
if ImageEnView1.Selected then
begin
--->> ImageEnView1.AlphaChannel;
ImageEnView1.MakeSelectionFeather(10);
ImageEnView1.LayersCreateFromSelection;
ImageEnView1.MouseInteract:=[miResizeLayers,miMoveLayers];
ImageEnView1.DeSelect;
end;
end;



Klaus
www.klausdoege.de
klausdoege Posted - Nov 15 2013 : 10:34:52
Hello developers,
can I hope that this functionality, in the next version again existing is.
For some of my programs, it is very important to generate layer from soft selections.

Klaus
www.klausdoege.de
klausdoege Posted - Nov 09 2013 : 14:51:59
Hello William,
I have checked it with the lasso again.
Here the source code.

procedure TMainForm.SelectLassoClick(Sender: TObject);
begin
   ImageEnView1.MouseInteract:=[miselectlasso];
   ImageEnView1.SelectionMaskDepth := 8;
end;

procedure TMainForm.AddLayerfromSelectionClick(Sender: TObject);
begin
   if ImageEnView1.Selected then
   begin
     ImageEnView1.MakeSelectionFeather(10);
     ImageEnView1.LayersCreateFromSelection;
     ImageEnView1.MouseInteract:=[miResizeLayers,miMoveLayers];
     ImageEnView1.DeSelect;
   end;
end; 

With imageen v431 works out all great, it works out with v500 no longer.
I use this function for a long time,
and have not determined this mistake with former versions.

Here once again examples with v4.3.1 and v5.0.0.

Version 4.3.1 layer it's OK

69.77 KB

Version 5.0.0 layer it's wrong

69.25 KB

whats is change in v5.0.0 ?

Klaus
www.klausdoege.de
w2m Posted - Nov 08 2013 : 09:37:35
This is a very difficult thing to accomplish with ImageEn. I tried using the Clipboard and AddLayer but there are a couple of problems.

When you use the clipboard SelCopyToClip with a SelectionMask the entire image is copied to the clipboard rather than the selection. The other problem is the alphachannel. It is difficult to render the pixels outside of the "object" as transparent because usually there are a lot of colors to make transparent which make it difficult to accomplish the correct transparency around the "object".

Maybe Nigel or Fabrizio can provide some more assistance with this. I'd be interested to see what they say as well.

if ImageEnView.Selected then
  begin
    ImageEnView.SelectionMaskDepth := 8;
    ImageEnView.SelectionIntensity := 128;
    ImageEnView.Proc.SelCopyToClip(True);
    iLayer := ImageEnView.LayersAdd;
    ImageEnView.Proc.Fill(clwhite);
    ImageEnView.Proc.SetTransparentColors(TColor2TRGB(clWhite), TColor2TRGB(clWhite), 0);
    ImageEnView.SelectEllipse(100, 100, 200, 200);
    ImageEnView.MakeSelectionFeather(10);
    ImageEnView.Proc.SelPasteFromClipStretch();
    ImageEnView.MouseInteract := [miResizeLayers, miMoveLayers];
  end;


William Miller
klausdoege Posted - Nov 08 2013 : 01:30:38
Hello Nigel,

i now my English is not good.
Obviously, I have expressed myself incorrectly.
I would like a layer, where only the ellipse, or the area which selected with lasso to see is, but with soft edge.
Then, I want to postpone the layer and at another place in the picture inserts.
Just like here.



119.54 KB

Klaus
www.klausdoege.de
w2m Posted - Nov 07 2013 : 12:54:16
The ellipse selection is probably not being shown because the selected layer is being shown instead because you changed the selection to ImageEnView1.MouseInteract:=[miResizeLayers,miMoveLayers];

When you call SelectEllipse all is fine. When you call AddLayerFromSelection the ellipse selection is changed to a layer selection.

Since you now allow moving layers, just click on the selection and move the mouse. The layer will be moved.

You can use this to distinguish between a normal selection and a layer selection:
ImageEnView.SetSelectionGripStyle(clBlack, $00BAFFFF, bsSolid, 8, True,iegsCircle);
ImageEnView.SetLayersGripStyle(clBlack, $00FF901E, bsSolid, 8, iegsCircle);

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html