Crystal Image Toolkit: 1.0.0 release, Factory and Refactoring

| | Comments (2)

Crystal Image Toolkit 1.0.0 is ready to download.

Enhancements:

Factory object:  CrystalCollectorFactory was added to allow you to create the correct collector objects based on file or folder input.  Using this factory will help keep track of when objects are created.  See this post for details.

CrystalCollector: added StopCollector as a pure virtual method.  StopCollector stops the collection operation initiated by CollectImages.


CrystalCollector:  SortCrystalList with CrystalSortType.DisplayName will now sort the image items with case insensitivity.  This sort option uses DisplayNameLower property in CrystalImageItem.


CrystalImageItem:  Added ImageCorrupted property.  True means image is corrupt and cannot be displayed, false means it is safe to display.


CrystalImageItem:  Added DisplayNameLower property.  Takes the DisplayName string and does a ToLower call.


CrystalImageItem, CrystalCollector, and CrystalImageGridModel all implement IDisposable.  This objects hold references to Image objects, which can now be disposed of more efficiently.


Event notification: All events are now broadcast using the EventNotifier class.  This utility walks through the invocation list of a multi-cast delegate and checks to see if InvokeRequired is true before calling the delegate.

Code Cleanup:

Exception Handling Refactoring: Previously, the Crystal  Image Toolkit was eating all exceptions.  This was a bad practice and actually hid threading errors that were occurring in the forms and controls that were using the toolkit.  Now those exception handlers have all been removed, except for one in CrystalFileCollector:  LoadImage.  The exception here is caught when an image is corrupt and cannot be loaded from the disk.  In that case, ImageCorrupted in CrystalImageItem is set to true, see below.


CrystalCollector: AddView method was removed.  I had intended to support multiple views, but I need to wrap up this toolkit for the time being and move on to other projects.  Only 1 view is supported.  AddView has been changed to SetupView.  The internal list of views has been removed.

 

Download: Crystal Image Toolkit 1.0.0.  Totally free, open-source, C# .NET Framework 2.0 for Windows Forms, works with both Visual Studio 2005 and 2008.

2 Comments

I have downloaded the Crystal Image Toolkit 1.0.0. It works perfectly for me. I only have ONE problem though. I cannot read images of ".TIF" format. Any idea? Has it got something to do with the initial image index in this class?
_picController.InitCollector(folder path, initialImageIndex).

Thanks and looking forward to your response?

Isaac

If you look at the CrystalFileCollector object, you will see a property called ImageFilter that is initially set for you:

public CrystalFileCollector()
{
ImageLocation = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
ImageFilter = "*.bmp,*.jpg,*.jpeg,*.gif,*.png,*.exif,*.tiff";

Just change this to:

ImageFilter = "*.bmp,*.jpg,*.jpeg,*.gif,*.png,*.exif,*.tiff,*.tif";

And it should be able to process .tif files.

// Richard

Leave a comment