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
 TImageEnView.Select sets an incorrect selection
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

gui

1 Posts

Posted - Dec 01 2019 :  04:13:52  Show Profile  Reply
Hi,

Great product, I'll purchase soon but I have a problem with the trial.

I do not understand why TImageEnView.Select here does not work as expected.

First, I store the initial user selection in the variable with:

InitialCaptureRect := ImageEnView1.SelectedRect;

when the window closes.

I then reopen the window, load the same bitmap, and try to restore the previous user selection with:

ImageEnView1.MouseInteractGeneral := [miSelect];
ImageEnView1.SelectionBase := iesbBitmap;
ImageEnView1.Select( InitialCaptureRect.x , InitialCaptureRect.y, InitialCaptureRect.x + InitialCaptureRect.width, InitialCaptureRect.y+ InitialCaptureRect.height);

The X and Y coordinates are correctly restored, but not the width and height: the restored selection appears smaller each time.

Since I'm using the trial, I can't debug the code. So I'm looking for your help.

Thanks!

gui

xequte

38180 Posts

Posted - Dec 03 2019 :  03:30:37  Show Profile  Reply
Hi

We tried to replicate using following code:


var
  InitialCaptureRect: TIERectangle;

procedure TForm1.Button1Click(Sender: TObject);
begin
  imageenview1.io.loadfromfile('test.jpg');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  InitialCaptureRect := imageenview1.SelectedRect;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  imageenview1.MouseInteractGeneral := [miSelect];
  imageenview1.SelectionBase := iesbBitmap;
  imageenview1.Select( InitialCaptureRect.x , InitialCaptureRect.y, InitialCaptureRect.x + InitialCaptureRect.width, InitialCaptureRect.y+ InitialCaptureRect.height);
end;


Pressing Button1 loads the image. Repeating Button2 and Button3 sequence you always get the same selection, so I cannot reproduce the issue.



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