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
 Rotate multiple selected pages
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

AndNit

Brazil
18 Posts

Posted - Apr 20 2021 :  16:38:32  Show Profile  Reply
Good afternoon,

how do I rotate several pages already selected in an ImageEnMView, for example:

I have an ImageEnMView with 10 images, I selected 1, 3, 5 and 7 and I want to change the orientation of only those selected, I have read the manual a lot and searched here on the forum, but I can't find anything, just one by one.

Thank you for your attention

xequte

6525 Posts

Posted - Apr 21 2021 :  01:49:52  Show Profile  Reply
Hi

You could do it like this:

// Rotate some of the images right (90 clockwise)
RotImages := [2, 4, 5];
for i := 0 to ImageEnMView1.ImageCount - 1 do
  if i in RotImages then
  begin
    bmp := ImageEnMView1.GetTIEBitmap( i );
    bmp.Rotate( 270 );
    ImageEnMView1.ReleaseBitmap( i, True );
  end;
ImageEnMView1.Update();


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

xequte

6525 Posts

Posted - Apr 21 2021 :  01:56:42  Show Profile  Reply
Or to just rotate the selected:

// Rotate selected images right (90 clockwise)
for i := 0 to ImageEnMView1.MultiSelectedImagesCount - 1 do
begin
  selIdx := ImageEnMView1.MultiSelectedImages[ i ];
  bmp := ImageEnMView1.GetTIEBitmap( selIdx );
  bmp.Rotate( 270 );
  ImageEnMView1.ReleaseBitmap( selIdx, True );
end;
ImageEnMView1.Update();


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

AndNit

Brazil
18 Posts

Posted - Apr 22 2021 :  10:15:16  Show Profile  Reply
I couldn't run with the codes, but I found this solution here:

var
  i : Integer;
  bmp: TIEBitmap;
  lista : TIEArrayOfInteger;
begin
 lista := ImageEnMView1.MultiSelectedImagesList;
 for i := 0 to ImageEnMView1.MultiSelectedImagesCount - 1 do 
  begin
    bmp := ImageEnMView1.GetTIEBitmap( lista[i] );
    bmp.Rotate( 270 );
    ImageEnMView1.ReleaseBitmap( lista[i] , True );
  end;
  ImageEnMView1.Update();
end;



thanks

Go to Top of Page

xequte

6525 Posts

Posted - Apr 22 2021 :  21:53:44  Show Profile  Reply
Sorry, I left a line out of my code. I have updated it now.

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