The Developers Image Library is an Open Source graphics project hosted on the Sourceforge site, that allows the opening, saving, and processing of a host of images stored in different graphics formats. This project inherits a Delphi OpenDialog, adds an image preview thumbnail to the dialog (much as in a typical OpenPictureDialog) and then ties into the image library DLL to generate previews of many additional filetypes not included in a standard OpenPictureDialog. Note that the code needs some work to open Metafiles, since these are not included the library DLL. The graphic shows the completed dialog showing a thumbnail preview of a TIFF format image...
The home home page for the library is found at the following location http://sourceforge.net/projects/openil/. The download page contains links to the source code under the heading 'DevIL', documentation under the heading 'Docs and Tutorials', and binaries (three compiled DLLs) under the headiing 'Windows End User', and the Linux and Windows SDK, and is currently located at the following URL ->
Dil download page
The three DLLs must be included in your program path if you wish to use the library. The code for the OpenDialog (which is called OpenDILPicDialog) has the lines referring to the 'Register' function commented out, so that it functions as a unit, rather than as Component. If you use the dialog as a component then I have found that including all the header files (for OpenGL and the ImageLibary) in the Source/Samples Delphi folder will work, and the DLLs can be placed into the Delphi bin directory, for use at design time.
Note that according to what I have read if a component exists on the VCL that depends on DLLs and the DLL is not present on the VCL enviroment path then the entire loading of the VCL will apparently fail leaving you with no components at all, so if this dialog is installed as a component rather than being used as a unit, you must ensure that the DLLs are in the bin directory to avoid problems
Note that the library seems to have problems with GIF images but otherwise works very well ... for GIFs an alternative might be to use Anders Melanders TGifImage, which has now been moved to the Project Delphi Jedi site. As well there are numerous versions of PCX, none of them backwards compatible, and few graphics programs support them all, and that is true of this library as well, so it will generate PCX errors when encountering one of these other unsupported PCX formats...It also does not seem to support Huffman encoded or FAX encoded TIFF images (however, it could be the case that images in these formats are supposed to be monochrome with no grey scale, which is how they turn out...You should also be aware that LZW compression is patented by Unisys (although the patent is just about ready to expire) so if you use LZW compression in a program you will need to register and pay some kind of royalties. I am currently working on a SaveDialog, which is a little more complicated, and if you read the header files for the Library you will notice constants used which define compression, for example, and also functions and procedures that compress images in the library format (note that this format is not 'a bitmap', but the internal format of the library), and it will be neccesary, to implement a SaveDialog, to become completely familiar with what is and what is not a legal operation for each different file format to be able to control the save process (it is possible to save using constants that define a default value, for example to save a 'default' TIFF, but if you want control, this requires greater control and greater understanding. Opening a graphic is much simpler since the options already exist in the file, and the library opens the files in a way which is transparent to the end user.
The new dialog inherits a standard OpenDialog, adds components to display the thumbnail graphics and then overrides the 'DoShow' event code, to allow resizing of the dialog and placement of the thumbnail panel and image, and overrides the 'DoSelectionChange' event code to allow for creation and display of a thumbnail graphic based on the name of the newly selected graphics file. The unit also overrides the Create and Destroy event codes to allow for creation of the thumbnail image components, initialization of the DLL library, and for the destruction of these extra elements when the dialog is destroyed. The code which interfaces with the DLL is incorporated in the DoSelectionChange event code and is pretty straightforward. The image library uses a private internal format to manipulate images, but in this example the image is converted to a standard DIB (device independent bitmap) and then converted to a thumbnail for display in a TImage component. However it might be a better idea to create the Bitmap during the ONshow event and then destroy the bitmap during the 'close' of the box, leaving the user to with a filename to use to implement the code to actually load the image, either as a DIB or in the native format of the DLL. On older windows systems having to many bitmaps around causes the system to become unstable. This still leaves the problem of deciding whether or not to initialize the library in the main program, before using the Dialog, which introduces a dependency, but is probably the better way to go if the library is going to be used by the main program. If the Dialog is going to function as the interface to the DLL for the program, then it also makes sense to dynamically load the DLL, during the 'show' event, and then free the library when the Dialog is closed.
Typically an OpenDialog allows the selection of a filename, but in this simple example, ABitmap has been made a public component of the Dialog, and since the dialog needs the Bitmap to create the thumbnail, the image can be retrieved directly from the dialog. It would also be possible to encapsulate the Bitmap into the dialog, and destroy it when its not needed and this would entail passing back only a filename to the program, and the program would then need to implement the loading of the image. The DoSelectionChange code demonstrates one way to do this, although a program could also work with the image, not as a bitmap, but rather using the internal private format of the image library, converting to a dib only for display purposes.
The OpenDialog includes a method called 'GetStaticRect' which is supposed to allow for resizing of the dialog to add components, but this does not seem to work, and after a search on the net I found the following C++ page which demonstrated using 'GetClientRect' and 'GetWindowRect' to accomplish the same thing ... http://home.att.net/~secondcut/opdlgvcl.htm You can download the project as a zip file here ->
opend.zip 377 KB (including the DLLs)
openh.zip 97 KB (just the project and header files)
The library can open and manipulate files in the following formats... Bitmaps (BMP), Jpeg (JPE, JPG, JPEG), PCX, PNG, Portable Bitmap (PBM), Portable GreyMap (PGM), Portable PixelMap (PPM), Photoshop (PSD), Raw format (RAW), Silicon Graphics (BW, RGB, RGBA), Targa (TGA), TIFF and TIF, Interlaced Bitmap (LBM), PhotoCD (PCD), PIX, PIC, PNM, PXR, and XPM. The library is also supposed to do GIF images, but always seems to fail for some unknown reason. There are also other formats available such as Direct Draw surfaces, DOOM graphics, etc., which can be included (by including them in Dialog filter).
A Unified Field Theory
![]()
The Unified Field Theory
is also available as a zip file -> unified.zip
Introduction :The Pioneer Effect and the New Physics. A brief description of the new physics required to explain the 'Pioneer Effect', which is the constant deceleration of space craft as they fly through space.

