How to use ProgressBar for SaveToFile
method ? Actually I want to save a resource to a file, and have progress bar update from 0% to 100% as it saves, how do I do that?
相关问题
- Is there a Delphi 5 component that can handle .png
- Is there a way to install Delphi 2010 on Windows 2
- Is TWebBrowser dependant on IE version?
- In what practical case bool(std::ifstream) != std:
- iOS objective-c object: When to use release and wh
相关文章
- Best way to implement MVVM bindings (View <-> V
- MemoryStream disables reading when returned
- Convert HttpContent into byte[]
- Windows EventLog: How fast are operations with it?
- How to force Delphi compiler to display all hints
- Coloring cell background on firemonkey stringgrid
- MemoryStream.WriteTo(Stream destinationStream) ver
- c# saving very large bitmaps as jpegs (or any othe
You can make your own TResourceStream descendant like in the code below. But for large resources (and that's probably the case, otherwise you wouldn't have to see progress) it's better to "wrap" this in a separate thread. Yell if you need help with that.
Since it inherits from TStream you could use the Size property to get the total size and Position to get the current position. You can use those to 'drive' your progressbar. Then instead of using SaveToFile to write to the file you would use a seperate TFileStream and write to it block by block from TResourceStream. You could use the TStream.CopyFrom method for that last part.