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
 Proc ProgressBar?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

880 Posts

Posted - Jun 06 2024 :  08:06:04  Show Profile  Reply
I use this Proc method:

ImageEnView1.Proc.ConvertTo(ColorThresholds[i], ieOrdered);

With large images with a huge number of colors, this can take several seconds. Is it possible to update a ProgressBar showing the progress of Proc.ConvertTo?

I tested this one:

procedure TForm1.ImageEnView1Progress(Sender: TObject; per: Integer);
begin
  case ImageEnView1.Proc.ProgressTask of
    ietProcessing  : CodeSite.Send('Processsing: ', per);
    ietAnalysis    : CodeSite.Send('Analyzing: ',   per);
    ietResampling  : CodeSite.Send('Resizing: ',    per);
    ietRotating    : CodeSite.Send('Rotating: ',    per);
    else             CodeSite.Send('else: ',        per);  // Should not occur
  end;
end;


But it returned only the else case!

PeterPanino

880 Posts

Posted - Jun 06 2024 :  09:38:23  Show Profile  Reply
Now I tried this practical solution:


    ProgressBar1.Visible := True;
    try
      ReduceColors;
    finally
      ProgressBar1.Visible := False;
    end;
	
procedure TForm1.ImageEnView1Progress(Sender: TObject; per: Integer);
begin
  if not ProgressBar1.Visible then EXIT;

  ProgressBar1.Position := per;
end;


However, it does not really show a progress. It only shows the Progressbar at 100%.
Go to Top of Page

PeterPanino

880 Posts

Posted - Jun 06 2024 :  13:38:22  Show Profile  Reply
It seems that adding Application.ProcessMessages; to the ProgressBar actions helps.
Go to Top of Page

xequte

38319 Posts

Posted - Jun 06 2024 :  21:12:28  Show Profile  Reply
Hi Peter

I have fixed the ProgressTask not being set for some Proc methods. You can email me for the update.

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

PeterPanino

880 Posts

Posted - Jun 07 2024 :  03:13:59  Show Profile  Reply
Hi Nigel

Thank you for your fantastic support!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: