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
 Trapping Aborting With ImageEnMView
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Mar 18 2014 :  10:12:44  Show Profile  Reply
What event do you use to trap Aborting with ImageEnMView1.LoadFromFileOnDemand?

I am loading very large multi-frame TIFF file and need to detect if a frame is corrupted.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development

xequte

38610 Posts

Posted - Mar 18 2014 :  21:42:47  Show Profile  Reply
Hi Bill

OnWrongImage will be called if an image cannot be loaded within an OnDemand sequence.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Mar 19 2014 :  11:54:01  Show Profile  Reply
Nigel,

How do you do the same thing, but with LoadFromFile and then call
if Aborting then Replace the corrupted frame with an error.png?

Something like this...

try
  ImageEnMView1.MIO.LoadFromFile(AFilePath); {Optional loading method }
except
  if ImageEnMView1.MIO.Aborting then
  begin
    ImageEnMView1.MIO.Params[ImageEnMView1.ImageCount-1].TIFF_ImageIndex := ImageEnMView1.ImageCount-1;
    ImageEnMView1.MIO.LoadFromFile(IncludeTrailingPathDelimiter(ExtractFileDir(Application.ExeName)) + 'error.png');
   end;
end;

William Miller
Go to Top of Page

xequte

38610 Posts

Posted - Mar 19 2014 :  21:19:12  Show Profile  Reply
Hi Bill

Do you have an image with a corrupted frame like this so I can do some tests.



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