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
 ImageEnView.LayersSync removal
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

klausdoege

Germany
389 Posts

Posted - May 24 2017 :  09:48:03  Show Profile  Reply
Hello,
After the removal of ImageEnView.LayersSync in version 7.0.
Another layer is no longer on Posxy (0,0).
You have to correct it yourself.
Is there a better solution?

Klaus
www.klausdoege.de

xequte

38613 Posts

Posted - May 24 2017 :  20:05:17  Show Profile  Reply
Hi Klaus

Sorry, to clarify, you were using LayersSync = True, in the older version?

The default position for new layers should be 0,0. What steps are you taking and what are you trying to achieve?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - May 27 2017 :  17:36:25  Show Profile  Reply
Hello Nigel,
yes in my old version layersync=true.
Now i have tested with your example, see picture.
Desktop1 it's the original picture.
Desktop2 add layer works correct, then autofit=true,
Desktop3 if autofit not true and the picture not fill the area complete.
Then the new layer not on posxy(0,0).
The same is happens by addlayerfromselection-
Regards
Klaus







Klaus
www.klausdoege.de
Go to Top of Page

xequte

38613 Posts

Posted - May 28 2017 :  15:13:17  Show Profile  Reply
Hi Klaus

Yes, we now advance the position. Please set the PosX and PosY when creating the layer.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - May 29 2017 :  12:42:13  Show Profile  Reply
Hello Nigel,
yes, i can do that.
But then next problem , i have by imageenview.addlayerfromselection.
See Example:
Desktop1 = Original with selection (autofit=true)
Desktop2 = Addlayer fromselection it's OK
Desktop3 = Selection in Original (autofit=false)
Desktop4 = addlayerfromselection wrong area, layer is not the selection ?
Regards
Klaus










Klaus
www.klausdoege.de
Go to Top of Page

w2m

USA
1990 Posts

Posted - May 29 2017 :  13:20:34  Show Profile  Reply
ImageEn 7.0 does not have AddLayerFromSelection. It does have ImageEnView1.LayersCreateFromSelection, but the selection should be removed after creating the layer. If you are using a older version of ImageEn that has AddLayerFromSelection I am not sure of the differences between them.

procedure TForm1.CreateLayersFromSelection1Click(Sender: TObject);
var
  iLayer: Integer;
begin
  Screen.Cursor := crHourglass;
  try
    { Copy selected area and create a new layer }
    iLayer := ImageEnView1.LayersCreateFromSelection;
    ImageEnView1.Layers[iLayer].Name := 'Image Layer';
    { Move the new layer }
    ImageEnView1.CurrentLayer.PosX := ImageEnView1.CurrentLayer.PosX + 200;
    ImageEnView1.CurrentLayer.PosY := ImageEnView1.CurrentLayer.PosY + 200;
    ImageEnView1.Update;
    ImageEnView1.Deselect;
    ImageEnView1.MouseInteract := [miMoveLayers, miResizeLayers];
    ImageEnView1.IEBitmap.Modified := True;
    ImageEnView1.SetFocus;
    DrawLayers;
    UpdateGUI;
    UpdateLayers;
    UpdateStatusBar;
  finally
    Screen.Cursor := crDefault;
  end;
end;

I am not sure if this helps, but be aware you have to convert to layer coordinates when using layers and selections:

function ConvXScr2Bmp(x: Integer): Integer;

Description
Converts screen coordinates to bitmap coordinates, with consideration to the layer position and size.

See Also
TImageEnView.XScr2Bmp
TIELayer.ConvYScr2Bmp
TIELayer.ConvXBmp2Scr
TIELayer.ConvYBmp2Scr

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - May 29 2017 :  15:37:14  Show Profile  Reply
Hello Bill,
sorry my mistake.
I mine imageenvect.LayersCreateFromSelection;
I use mageEn 7.0.
With ImageEn 6.3.3 i not have this problem.
I have tested with your example, the same result.
Please check it again.
Klaus


Klaus
www.klausdoege.de
Go to Top of Page

w2m

USA
1990 Posts

Posted - May 29 2017 :  15:39:55  Show Profile  Reply
Sorry Klaus,

Creation of a layer from a selection works perfectly here. I do not see any problems and I am failing to understand what your exact problem is.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

38613 Posts

Posted - May 29 2017 :  21:45:32  Show Profile  Reply
Hi Klaus

Yes, there seems to be an issue if the base layer is moved off 0,0. Please email me for a source update.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

klausdoege

Germany
389 Posts

Posted - Jun 01 2017 :  07:08:55  Show Profile  Reply
Hi Nigel,
thank you, now it works fine.

Klaus
www.klausdoege.de
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: