ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnMView.OnProgress ?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Alexey Posted - Mar 13 2013 : 12:10:11
Hello

If I use just TImageEnView.IO.LoadFromFile then the event OnProgress occurs many times during big file loading and allows to show a real I/O progress for File Loading. But If I use TImageEnMView.MIO.LoadFromFile then OnProgress handler is called only two times for 0 and 100 %.
Is there any way to get a real/smooth file loading progress from TImageEnMView.MIO. I use it to load multipage TIFF files.

Thanks.
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Mar 15 2013 : 10:30:47
This is because either the multipage tif pages are loading very quickly, or the progressbar is not being refreshed to show the change. One way you can control this by doing this:
procedure TForm1.ImageEnMView1Progress(Sender: TObject; per: Integer);
begin
  // Make sure ProgressBar1.Max is 100 before loading the file
  // Set the progressbar position
  ProgressBar1.Position := per;
  // Without this the progress may be too fast to see progress bar changes visually
  // Adjust this sleep time to control the speed of loading
  Sleep(500);  
  // Update the progressbar
  Application.ProcessMessages;
end;

procedure TForm1.ImageEnMView1FinishWork(Sender: TObject);
begin
 //Themed progressbars may not be refreshed fully as the progress nears completion.  This can be improved by using this code or by using a third party progressbar:
 ProgressBar1.Position := 100-1;
 ProgressBar1.Position := 100;
 ProgressBar1.Position := 100-1;
 Sleep(500);
 ProgressBar1.Position := 0;
end;

Another but much more difficult way is to update the progressbar in a thread.

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html