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
 Assign to ImageENView with Transition?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Patrick Quinn

United Kingdom
81 Posts

Posted - Aug 21 2011 :  15:42:26  Show Profile  Reply
To show images full-screen in my viewer program, I use a borderless maximised form with an ImageENView aligned to alClient.
The user can cycle through full screen images of the main form ImageEnMview thumbnails, using the keyboard, with a transition at each image change.

This works very well - the transitions looks great - but on large images there is a noticeable lag between pressing the keyboard and the ImageEnView starting the transition, as it has to load the image from disk.

To get rid of this lag, I have tried using two TIEBitmaps (both with a TImageEnIO attached), and pre-loading the previous and next images into these.
I then then use:

ImageEnView.PrepareTransition
ImageEnView.IEBitmap.AssignImage(My TIEBitmap)
ImageEnView.RunTransition(xxx, xxx).

This gets rid of the time lag, but introduces a new problem - the ImageEnView doesn't autofit the image until the transition has finished, causing the image to jerk as it resizes when the transition finishes.

I guess assigning the new image to the ImageEnView.IEBitmap is wrong?
Is there a correct way of pre-loading an image then using transitions?

I hope I've explained this ok.

regards

Patrick

fab

1310 Posts

Posted - Aug 21 2011 :  22:48:25  Show Profile  Reply
Hello,
call Update() just after AssignImage:

ImageEnView.PrepareTransition();
ImageEnView.IEBitmap.AssignImage(My TIEBitmap);
ImageEnView.Update(); <----
ImageEnView.RunTransition(xxx, xxx);
Go to Top of Page

Patrick Quinn

United Kingdom
81 Posts

Posted - Aug 22 2011 :  01:33:11  Show Profile  Reply
fabrizio

Thank you very much for your very quick reply.

Yes, that works!

(I should have thought of trying Update, but am still learning ImageEn. The more I learn, the more I realise how powerful ImageEn is. There is a lot to learn, though...)

regards

Patrick
Go to Top of Page

fab

1310 Posts

Posted - Aug 22 2011 :  01:46:12  Show Profile  Reply
Actually ImageEnView.Update() is necessary whenever you change the internal IEBitmap (or Bitmap), but not for ImageEnView.Proc.etc calls. For example:

// update necessary
ImageEnView.IEBitmap.Fill(clBlack);
ImageEnView.Update();

// update not necessary
ImageEnView.Proc.Fill(clBlack);
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: