Said Savci
Said Savci

Reputation: 858

Fast Image Loading from Network Drive in C#

I have a C# application that needs to load about 50 TIFF images from a network drive. Each of these images has a size of about 10-15 MByte. I have to load these images, resize them, and export them in a PDF file.

Currently, I am using the following method to load the images from the network drive

Image image = Bitmap.FromFile(path.LocalPath);

The problem is that loading the 50 images takes quite a lot time that is not tolerable for my application scenario. Is there a way to speed up the image loading process?

Upvotes: 0

Views: 1667

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1500525

I suggest you copy them to a local drive first. I suspect that Bitmap.FromFile may seek around the file (possibly reading redundantly) in a way which isn't a good fit for network drives - whereas just copying the files locally and then using Bitmap.FromFile does the expensive part (the network transfer) once.

Upvotes: 3

Related Questions