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
 Wait for file to exist after SaveToFile?

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
PeterPanino Posted - Oct 13 2017 : 07:53:32
I save a file with:

ThisImageFile := MyPath + 'MyImage.png';
ImageEnView1.IO.SaveToFile(ThisImageFile);
CopyFile(ThisImageFile, TargetFile);


As you can see from this code, CopyFile needs the source file to exist.

So how can I ensure that right after "ImageEnView1.IO.SaveToFile" the file already exists?

Does "ImageEnView1.IO.SaveToFile" return only after the file already exists?

Or is there a mechanism to wait after "ImageEnView1.IO.SaveToFile" until the file exists?
2   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Oct 14 2017 : 06:54:04
Nigel, thanks for the clarification.
xequte Posted - Oct 14 2017 : 04:46:35
Hi Peter

Please see:

https://www.imageen.com/help/TImageEnIO.SaveToFile.html

By default, SaveToFile is blocking. Also, in case of save error an exception is raised. So in your code above, "ThisImageFile" should always exist.

e.g.

ThisImageFile := MyPath + 'MyImage.png';
try
  ImageEnView1.IO.SaveToFile(ThisImageFile);
  CopyFile(ThisImageFile, TargetFile);
except
  ShowMessage('Could not save ' + ThisImageFile );
end;



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com