Click here to Skip to main content
13,861,285 members
Click here to Skip to main content
Add your own
alternative version


78 bookmarked
Posted 9 Oct 2006
Licenced LGPL3

An Application to Create Interesting and Fully Customizable Web Photo Gallery

, 4 Apr 2007
Rate this:
Please Sign up or sign in to vote.
An application to create interesting and fully customizable Web photo gallery using plugins for generating pages


This application is useful to generate in few minutes an HTML photogallery from several source images.
You can also insert text over enlarged images semi-transparently, defining its position, size, shadow, and optionally with a background shape like a rectangle or an ellipse and a 3D effect.
Moreover you can impress a watermark image on the target enlarged images defining the transparency key, the size in percentage of the target image, the transparency level, and the position.
You can use masks to add corners and shapes to images (thumbnails and/or enlarged).
You can convert images between formats.
Finally, you can make an interesting shadow effect like a picture over a colored or blank sheet picking colors from page templates or other sources.
The pages are generated using HTML templates customizable by the user.

Several formats are supported: JPG (with customizable compression level), GIF, PNG, WMF, TIFF, EXIT and ICO.

The tool has a nice look and a user friendly interface.
The application is fully extensible using DLL plugins to have different HTML styles.


This application extends "batch image" project presented in my previous article

The target use of "extended Web gallery" is different than "batch image": while "batch image" is useful for creating images in batch, with "extended Web gallery" you can create an HTML photo gallery using various styles.

HTML Styles using Plugins

The HTML generation is plugin based. Anyone can write your own plugin to have a fully custom photo gallery style.

Actually I've implemented three base plugins that have the following layouts: standard table, horizontal autoscroll frame and vertical autoscroll frame.

The plugins have to implement the following interface (IPlugins):

public interface IPlugin
    event EventHandler FinishWork;
    System.Windows.Forms.UserControl GetPluginInterface();
    string Name { get; }
    string Description { get; }
    Bitmap sample { get;}
    object Action(object data);
    void ThreadOperate(CParams.ThreadOperation operation);
    void SetParameters(List<CPARAMS> paramlist);
    void SetMainTemplate(List<STRING> before, List<STRING> after);
    void SetPagesTemplate(List<STRING>before, List<STRING> after);
    void SetDirs(string outputpath, string imagepath, 
		string thumbnailspath, string pagespath, string pagesextension);
    void Serialize(Stream myStream, ref IFormatter formatter);
    void DeSerialize(Stream myStream, ref IFormatter formatter);

When the application starts, the plugin manager (Plugger) checks the presence of the plugins in the "Plugins" directory:

private void LoadPluginsFromAssemly(System.Reflection.Assembly assembly)
            Type[] types = assembly.GetTypes();
            foreach (Type type in types)
                if (type.IsPublic && !type.IsAbstract)
                    Type typeInterface = type.GetInterface("IPlugin", true);

                    if (typeInterface != null)
                        ListItem listitem = new ListItem();
                        listitem.plugin = Activator.CreateInstance(type) as IPlugin;
                        listitem.filename = type.Module.ToString();

                        if (listitem.plugin == null)

                        listitem.plugin.FinishWork += new EventHandler(plugin_Evento);


Thanks to jonnynolimits for the precious support for plugin reading.

Using Masks

You can use masks to obtain cool image effects. A mask is a common image that is put over the original. Obviously, you can define a transparency key.

So, this is the result (using horizontal frame plugin) that is like a film.

You can quickly create new mask images using several shapes or sources.

Demo Galleries

Standard table

Horizontal frame

Vertical frame

External Links

I'm going to write some user documentation. Follow this link (actually I'm working on writing a user guide).


Please report bugs!


This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


About the Author

Web Developer
Italy Italy
I'm an electronic engeneer form Genoa.
I like very much dotnet and C#. I've developed some works like an html gallery generator, a graphic formula viewer (user defined), a webcam grabber and html gallery generator, a little framework for image processing, an image resizer, elaboration in batch and some other application tool.
Actually I'm working in VC++ 6 MFC, but I hope that my future is .net !!!
Some of my works are downloadable at:
Lorenzo Banderali

You may also be interested in...


Comments and Discussions

QuestionLol Pin
kkoukakis15-Sep-12 22:55
memberkkoukakis15-Sep-12 22:55 
Generaldude you didnt even comment plugin interface :) no mind reader Pin
Member 26397193-Jul-09 11:57
memberMember 26397193-Jul-09 11:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web01 | 2.8.190214.1 | Last Updated 4 Apr 2007
Article Copyright 2006 by Lorenzo1981Ge
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid