Click here to Skip to main content
13,141,286 members (82,013 online)
Click here to Skip to main content
Add your own
alternative version


29 bookmarked
Posted 4 Jan 2006

Fireball.Core FreeImage Wrapper

, 4 Jan 2006
Rate this:
Please Sign up or sign in to vote.
Discover the Fireball.Core FreeImage wrapper for C#.

Free Image Demo Example


Fireball.Core is class library developed with C#, with the objective to integrate an API that I need for my daily work, and as a base for my other open source libraries. In this article, I can only describe the FreeImage class, but on the Fireball.Core library there are some other classes presented as well.


FreeImage is the best open source class library for manipulating images. To get the Fireball.Core library working, you need to download it from SourceForge. The binary version for Windows is to be downloaded and put on C:\Windows\System32. I also provide here a little example project, for showing how simple it is to use it, but the example is incomplete and the wrapper needs more work.

Using the code

Using the FreeImage wrapper is very simple, you need only to reference the Fireball.Core.dll on your project and add an using directive and instanciate the class with a filename.

using System;
using System.Drawing;

public class test

    FreeImage _fi = null;

    public void LoadImage(string filename)
        _fi = new FreeImage(filename);

Now, you have the image file loaded. On that image, you can apply a rotation, a brightness change or contrast. See the example that applies a rotation, here:

public void Rotate(double angle)

Example: if you call test.Rotate(25); you have applied to your image a left rotation of 25 degrees!!

For a more detailed class view, see this image exported from the Visual Studio class diagram.

Now, for applying some effects, I am implementing a FreeImageTrasformation class that is a base class for all transformation classes, like FreeImageRescale. For example, you have a 1240 x 1200 image, and you need to rescale it to 800 x 600; you can do that simply with two lines of code:

FreeImageRescale rscTransform = new FreeImageRescale(800, 600);

That is all for now! I don't have more time for writing. FreeImage is also the best when you need to manipulate big images, because the Bitmap class of the .NET framework doesn't support big images. If you are interested to contribute to this project, you can join the Fireball community by simply registering on the Fireball forums. On my website, you can find nightly builds on the download section. All code are under the terms of the LGPL license that gives you the possibility to link the library on to your commercial projects without the need to redistribute your code! You only need to enclose a lgpl.txt file on the same directory where the Fireball.Core library is located, with a link to my website. Any reference on your About message is very much appreciated ;)

Points of Interest

Please contribute to the Fireball project!


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Italy Italy
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralThanks Pin
Hamid Attari14-May-08 10:04
memberHamid Attari14-May-08 10:04 
GeneralWhen I save a big Image [modified] Pin
Jm2f25-Oct-06 23:56
memberJm2f25-Oct-06 23:56 
GeneralHDR images Pin
image_processor11-Jul-06 3:05
memberimage_processor11-Jul-06 3:05 
GeneralRotate Working Pin
Reanalyse10-Jan-06 15:47
memberReanalyse10-Jan-06 15:47 
GeneralRe: Rotate Working Pin
dotnetfireball15-Jan-06 8:27
memberdotnetfireball15-Jan-06 8:27 
GeneralRe: Rotate Working Pin
Reanalyse15-Jan-06 20:51
memberReanalyse15-Jan-06 20:51 
GeneralRe: Rotate Working Pin
Sander van Driel2-Mar-06 3:49
memberSander van Driel2-Mar-06 3:49 

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 | Terms of Use | Mobile
Web01 | 2.8.170915.1 | Last Updated 4 Jan 2006
Article Copyright 2006 by dotnetfireball
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid