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
 Problems rotation image on the second image
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

marcosgonzalez

Spain
3 Posts

Posted - Aug 25 2021 :  12:30:22  Show Profile  Reply
Hi. I'm doing a process with Imageen that open a TIFF image and rotate it some and rotate the image a few degrees.
This process works perfectly with the first image.
Later I load a second image through a loop and when I start to rotate the image, the first image appears again. I imagine that I have not freed a buffer, but I have been with it for a while and I do not detect the error.
Here you have part of the code:


  for i := 0 to num_images do
     begin
     Image.ClearAll();
     Image.Deselect();
     Image.IO.LoadFromFile(images[i]); // This function correctly loads and displays all images
     Image.Fit();
     Application.ProcessMessages;
     while not enc do
          begin
          // do some work
          Image.RotateTool.Rotation := -25+j; // But when you run this for the second and successive images, it reloads the first one
          end;
     end;



Could someone please help me?
Thanks in advance]

xequte

38801 Posts

Posted - Aug 25 2021 :  21:32:54  Show Profile  Reply
Hi Marcos

The issue with the code is that you have not enabled the rotate tool:

ImageEnView1.RotateTool.Enabled := True;


However it looks like you are only trying to programmatically rotate the image. The RotateTool is for interactive rotation (your users clicking to rotate the image).

If you only want to rotated the image programmatically, then use TImageEnProc.Rotate, e.g.

Image.Proc.Rotate( -25+j );

https://www.imageen.com/help/TImageEnProc.Rotate.html

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

marcosgonzalez

Spain
3 Posts

Posted - Aug 26 2021 :  02:41:20  Show Profile  Reply
Thanks so much xequte. That was the problem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: