Last post Sep 08, 2008 01:24 PM by ophedian
Sep 07, 2008 12:02 AM|ophedian|LINK
1) I am using a com component which holds a series of images in a locked database. The only way to access these images is first save them to a file and then use the Image.FromFile(path) and then I can use them in a .NET control. The problem is that there
is approximately 5000 plus images in one DB and 20,000 images in another DB.
If I do this [Pseudo Code]
List<Image> images = new List<Image>();
Foreach(ComImage ci in ComDLL.Images)
string tmpPath = "c:\\tempfolder\\" + Guide.NewGuid().ToString;
Image img = Image.FromFile(tmpPath);
The code runs slow because it has to write the image file to the harddrive then read the file into an image format.
Is there any way I can create a virtual file which resides in memory and can be written to and read from much faster. For example, if I can use stream objects, then i can write the image data onto a stream and then use the Image.FromStream(streamname).
This would speed up the whole process.
Remove File Handle
Sep 07, 2008 01:30 AM|MehrdadAfshari|LINK
Sep 08, 2008 01:24 PM|ophedian|LINK
Unfortunately there are no other methods available.. At the moment, I am working around this by creating ad hoc threads to run concurrently in order to speed the process up. This has helped on multi-core systems but it is still running relatively slow.