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
 Cropping problem in - CropSel and Crop
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Jul 27 2020 :  07:50:19  Show Profile  Reply
Hello,

I have observed that CropSel and Crop are not working properly when there are multiple layers in and image.

When I say not working properly means that it is cropping the image from top left of Layer[0] and not where marquee selection is present.

Please check these screen shots:

CurrentLayer is set to 0. Which is the bottom most layer. Please look at selection in the screen shot...


After calling ImageEnView1.Proc.CropSel(False);


I also tried this code:
ImageEnView1.Proc.Crop(ImageEnView1.SelectedRect.X, ImageEnView1.SelectedRect.Y, ImageEnView1.SelectedRect.X + ImageEnView1.SelectedRect.Width, ImageEnView1.SelectedRect.Y + ImageEnView1.SelectedRect.Height);


But this also does not work.

I am using IE 9.1.1.

Please help in solving this problem.

TIA


Yogi Yang

yogiyang

India
727 Posts

Posted - Jul 27 2020 :  08:31:48  Show Profile  Reply
Hello,

On further testing I found that Layer[0] does get cropped properly but all the other layers seems to get relocated.

This problem is also there in CropTool also.

How can we prevent this from happening?

TIA


Yogi Yang
Go to Top of Page

xequte

38616 Posts

Posted - Jul 27 2020 :  20:20:31  Show Profile  Reply
Hi Yogi

Can you give me the steps to reproduce the relocation issue in one of our demos?



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

yogiyang

India
727 Posts

Posted - Jul 28 2020 :  01:50:24  Show Profile  Reply
Hello,

Please open the demo project: Demos\ImageEditing\CropTool

And change the code of btnOpenClick to following:
procedure TForm1.btnOpenClick(Sender: TObject);
var
  sFilename: string;
begin
  sFilename := ImageEnView1.IO.ExecuteOpenDialog();
  if sFilename <> '' then
  begin
    ImageEnView1.IO.Params.PSD_LoadLayers := True;
    ImageEnView1.IO.Params.PSD_ReplaceLayers := True;
    ImageEnView1.IO.LoadFromFile( sFilename );
    ImageEnView1.Fit(  );

    ImageEnView1.LayersCurrent := 0;
    StartCropping( True );
  end;
end;


Now draw the area to be cropped and then click on the btnApplyCrop.

The are you select for Cropping should be in the middle or toward the right side of the image.

Here are the screen shots of before and after:








Yogi Yang
Go to Top of Page

xequte

38616 Posts

Posted - Jul 28 2020 :  15:48:12  Show Profile  Reply
Please give me a link to this PSD.

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

yogiyang

India
727 Posts

Posted - Jul 29 2020 :  07:17:09  Show Profile  Reply
As the file is very large, I am not able to attach it here. Please download it from here:
https://mega.nz/file/alRwFSwR#U5cEQSWiauo4L9qedwb6oYvzQ4iSsVP8_QF-GlGZhzg

One more file: https://mega.nz/file/ClwVQL4Z#Ajh6gY92d3tiCL-i38SrgsUCvNnxDkB2VPAtOKrN1d4


Yogi Yang
Go to Top of Page

yogiyang

India
727 Posts

Posted - Jul 30 2020 :  03:18:01  Show Profile  Reply
Please let me know when you have download the files so that I can remove them.


Yogi Yang
Go to Top of Page

xequte

38616 Posts

Posted - Jul 30 2020 :  23:02:55  Show Profile  Reply
Hi Yogi

All your layers have Cropped=True, so they are hidden because they are outside the background layer.

After loading call:

    for i := 1 to ImageEnView1.LayersCount - 1 do
      ImageEnView1.Layers[i].Cropped := False;


https://www.imageen.com/help/TIELayer.Cropped.html

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

yogiyang

India
727 Posts

Posted - Aug 01 2020 :  00:57:40  Show Profile  Reply
Hello Nigel,

Even doing this does not solve this problem as the BG Layer moved to 0,0

TIA


Yogi Yang
Go to Top of Page

xequte

38616 Posts

Posted - Aug 03 2020 :  02:08:37  Show Profile  Reply
Hi Yogi

You can email me for a fix for that.



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

kturkay

44 Posts

Posted - Sep 10 2020 :  07:12:54  Show Profile  Reply
think I faced that issue. did it manually.

used "LayersDrawTo" function instead of LayersSaveMergedTo
and ofsure Proc.Crop(....
Go to Top of Page

yogiyang

India
727 Posts

Posted - Sep 11 2020 :  00:11:35  Show Profile  Reply
Hello kturkay,

Actually I am waiting for the next update of IE to be released. I think it will be solved in that update.

TIA


Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: