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
 Best way to rotate images?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

skippix

USA
68 Posts

Posted - Sep 16 2022 :  08:34:11  Show Profile  Reply
Even though I have EnableAdjustOrientation := True for my TImageMView grid, not all the images are properly oriented.

At the moment, I have a function that allows the user to rotate one/some/all the images in the grid (this function actually rotates the file).

My problem is that I have to reload the entire grid. Is there a way to simply rotate the grid thumbnails without having to reload the grid?

Thanks!
Skip

xequte

38608 Posts

Posted - Sep 16 2022 :  17:15:20  Show Profile  Reply
Hi Skip

EnableAdjustOrientation uses the EXIF data to know whether the image needs to be rotated. If an image does not include the data, it cannot be automatically rotated.

What method are you using to rotate images in the grid?

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

skippix

USA
68 Posts

Posted - Sep 16 2022 :  21:56:42  Show Profile  Reply
My apologies, I just re-read my question and realize I was not clear.

I have a function that rotates the actual file. I am asking if there is a way to update the grid to show the rotation without having to reload the entire grid? If this isn't clear, I'll create an illustration to show what I'm trying to do.
Go to Top of Page

xequte

38608 Posts

Posted - Sep 19 2022 :  03:19:43  Show Profile  Reply
Hi

To update just a single image, use:

http://www.imageen.com/help/TImageEnMView.UpdateImage.html


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

skippix

USA
68 Posts

Posted - Sep 19 2022 :  04:46:28  Show Profile  Reply
Thanks, Nigel! That works perfectly for a single image.

I'm not quite sure about multiple images, though.

I have two lists, one of files to rotate and one of their grid indices. When I use the following code with multiple images selected, the grid only updates the last one on the list.


  for i := 0 to slFilesToRotate.Count-1 do
    begin
      if (TMenuItem(Sender).Tag = 0) then
        RotateThisJPeg270 (slFilesToRotate[i])
      else
        RotateThisJPeg (slFilesToRotate[i]);

      x := StrToInt(slRotatedFileIndexes[i]);
      imgGrid.UpdateImage(x);
    end;


When I embed the above code between imgGrid.LockUpdate and imgGrid.UnlockUpdate, the grid temporarily blanks out. Even though it works, it's not very pretty.

Any ideas as to how I can improve this?

Thanks!

Go to Top of Page

xequte

38608 Posts

Posted - Sep 21 2022 :  20:40:27  Show Profile  Reply
Hi

If your RotateThisJpeg() code uses ImageEnMView.Proc, you should not call UpdateImage() as it will occur internally.

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