Click here to Skip to main content
15,921,113 members
Articles / Programming Languages / C#
Article

C# Wrapper to the FreeImage DLL for graphical image format conversion

Rate me:
Please Sign up or sign in to vote.
4.67/5 (10 votes)
30 Sep 2003 289.4K   4.6K   42   49
This article provides a simplified C# wrapper to the FreeImage project for graphical file format conversion.

Introduction

FreeImage is an extremely useful Open Source project for reading, manipulating and converting a large amount of graphical formats. However at present the library exists as Win32 Dynamic Link Library. As my latest fascination is C#, I decided to create a simple Interop wrapper for it.

Using the code

The code is very straightforward to use, which is a reflection on the FreeImage implementation itself. For my needs I wanted to be able to take a picture file in Portable Bitmap (PBM) format and convert it to a standard Bitmap (BMP). For this I needed 3 methods exposed via the FreeImage DLL, FreeImage_Load, FreeImage_Save and FreeImage_Unload, the signature for which are:

C#
DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, 
       const char *filename, int flags FI_DEFAULT(0));
 
DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, 
   FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0)); 
 
DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP* dib);

Now the C# Interop signatures for these are:

C#
public class FreeImage
{
     [DllImport("FreeImage.dll")]
     public static extern int FreeImage_Load(FIF format,
                    string filename, int flags);

     [DllImport("FreeImage.dll")]
     public static extern void FreeImage_Unload(int handle);

     [DllImport("FreeImage.dll")]
     public static extern bool FreeImage_Save(FIF format,
        int handle, string filename, int flags);
}

As an example, to convert a graphical image from PBM to BMP, all you need to do is the following (note the enum FIF is not documented here, but can be found in the source code).

C#
namespace Test
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            int handle = FreeImageAPI.FreeImage.FreeImage_Load(
                FreeImageAPI.FIF.FIF_PBM,
                @"c:\image.pbm", 
                0);
                          
            FreeImageAPI.FreeImage.FreeImage_Save(
                FreeImageAPI.FIF.FIF_BMP,   
                handle, 
                @"c:\image.bmp", 
                0);
 
            FreeImageAPI.FreeImage.FreeImage_Unload(handle);          
        }
    }
}

License

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


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionTo those getting errors. Pin
Dave Simon17-Jun-21 10:12
Dave Simon17-Jun-21 10:12 
QuestionConversion of JPG to TGA gives zero KB TGA file Pin
dineshlepakshi16-Dec-13 14:24
dineshlepakshi16-Dec-13 14:24 
QuestionHow can I convert to JPG 2000 Pin
AmerSawan28-Dec-12 4:21
AmerSawan28-Dec-12 4:21 
GeneralStill no luck on Windows Mobile 6 Pin
Paul Kamath29-Oct-10 6:13
Paul Kamath29-Oct-10 6:13 
Generalfreeimage.dll must be in your windows\system32 folder Pin
Paul Kamath29-Oct-10 2:47
Paul Kamath29-Oct-10 2:47 
Generalc# compact frmework Pin
mightyCoCo3-Jun-08 10:22
mightyCoCo3-Jun-08 10:22 
GeneralRe: c# compact frmework Pin
Riyas Aboobaker24-Mar-09 6:28
Riyas Aboobaker24-Mar-09 6:28 
GeneralRe: c# compact frmework Pin
Riyas Aboobaker24-Mar-09 18:39
Riyas Aboobaker24-Mar-09 18:39 
QuestionHelp, I am getting zero file size as result Pin
Romashka_NN9-Apr-07 7:54
Romashka_NN9-Apr-07 7:54 
AnswerRe: Help, I am getting zero file size as result Pin
NoEscom15-Nov-07 21:37
NoEscom15-Nov-07 21:37 
GeneralResquest.OutputStream Pin
kernellius4-Apr-07 12:03
kernellius4-Apr-07 12:03 
QuestionWhat about large images? Pin
Gerrit Horeis6-Oct-06 3:17
Gerrit Horeis6-Oct-06 3:17 
Questionhelp Pin
xenia gr3-Sep-06 22:48
xenia gr3-Sep-06 22:48 
QuestionHow to convert double pointers (**)? Pin
vor0nwe26-Apr-06 5:37
vor0nwe26-Apr-06 5:37 
QuestionI can't make C# works with FreeImage Pin
mesh20055-Mar-06 21:41
mesh20055-Mar-06 21:41 
Questioninserting images in word document? Pin
Hiral Patel26-Nov-05 23:51
Hiral Patel26-Nov-05 23:51 
GeneralGrayscale Pin
EmailSolidale21-Sep-05 20:55
EmailSolidale21-Sep-05 20:55 
GeneralC:\projects\SVGTest\SVG.cs(145): Argument '2': cannot convert from 'int' to 'uint' Pin
eric paul2-Aug-05 12:12
eric paul2-Aug-05 12:12 
GeneralRe: C:\projects\SVGTest\SVG.cs(145): Argument '2': cannot convert from 'int' to 'uint' Pin
David Boland2-Aug-05 12:32
David Boland2-Aug-05 12:32 
Here is the interrop code I have for the Win32 FreeImage.dll library. As you can see this definition using unsigned int to represent the FIBITMAP object within the C# application. What I suggest is that you remove your reference to FreeImageNet.dll, paste this code into your own class and change you project to reference your interrop class. If your still getting problems then I can only suggest you change the definition or you make sure your using a compatible version of the FreeImage.dll file itself:


using System;
using System.IO;
using System.Runtime.InteropServices;

namespace FreeImageAPI
{
using PVOID = IntPtr;
using FIBITMAP = UInt32;
using FIMULTIBITMAP = UInt32;

[StructLayout(LayoutKind.Sequential)]
public class RGBQUAD
{
public byte rgbBlue;
public byte rgbGreen;
public byte rgbRed;
public byte rgbReserved;
}

[StructLayout(LayoutKind.Sequential)]
public class BITMAPINFOHEADER
{
public uint size;
public int width;
public int height;
public ushort biPlanes;
public ushort biBitCount;
public uint biCompression;
public uint biSizeImage;
public int biXPelsPerMeter;
public int biYPelsPerMeter;
public uint biClrUsed;
public uint biClrImportant;
}


[StructLayout(LayoutKind.Sequential)]
public class BITMAPINFO
{
public BITMAPINFOHEADER bmiHeader;
public RGBQUAD bmiColors;
}

public enum FIF
{
FIF_UNKNOWN = -1,
FIF_BMP = 0,
FIF_ICO = 1,
FIF_JPEG = 2,
FIF_JNG = 3,
FIF_KOALA = 4,
FIF_LBM = 5,
FIF_IFF = FIF_LBM,
FIF_MNG = 6,
FIF_PBM = 7,
FIF_PBMRAW = 8,
FIF_PCD = 9,
FIF_PCX = 10,
FIF_PGM = 11,
FIF_PGMRAW = 12,
FIF_PNG = 13,
FIF_PPM = 14,
FIF_PPMRAW = 15,
FIF_RAS = 16,
FIF_TARGA = 17,
FIF_TIFF = 18,
FIF_WBMP = 19,
FIF_PSD = 20,
FIF_CUT = 21,
FIF_XBM = 22,
FIF_XPM = 23,
FIF_DDS = 24,
FIF_GIF = 25
}

public enum FI_QUANTIZE
{
FIQ_WUQUANT = 0,
FIQ_NNQUANT = 1
}

public enum FI_DITHER
{
FID_FS = 0,
FID_BAYER4x4 = 1,
FID_BAYER8x8 = 2,
FID_CLUSTER6x6 = 3,
FID_CLUSTER8x8 = 4,
FID_CLUSTER16x16= 5
}

public enum FI_FILTER
{
FILTER_BOX = 0,
FILTER_BICUBIC = 1,
FILTER_BILINEAR = 2,
FILTER_BSPLINE = 3,
FILTER_CATMULLROM = 4,
FILTER_LANCZOS3 = 5
}

public enum FI_COLOR_CHANNEL
{
FICC_RGB = 0,
FICC_RED = 1,
FICC_GREEN = 2,
FICC_BLUE = 3,
FICC_ALPHA = 4,
FICC_BLACK = 5
}

public enum FIT // FREE_IMAGE_TYPE
{
FIT_UNKNOWN = 0,
FIT_BITMAP = 1,
FIT_UINT16 = 2,
FIT_INT16 = 3,
FIT_UINT32 = 4,
FIT_INT32 = 5,
FIT_FLOAT = 6,
FIT_DOUBLE = 7,
FIT_COMPLEX = 8
}

public delegate void FreeImage_OutputMessageFunction(FIF format, string msg);

public class FreeImage
{
// Init/Error routines ----------------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_Initialise")]
public static extern void Initialise(bool loadLocalPluginsOnly);

// alias for Americans Smile | :)
[DllImport("FreeImage.dll", EntryPoint="FreeImage_Initialise")]
public static extern void Initialize(bool loadLocalPluginsOnly);


[DllImport("FreeImage.dll", EntryPoint="FreeImage_DeInitialise")]
public static extern void DeInitialise();

// alias for Americians Smile | :)
[DllImport("FreeImage.dll", EntryPoint="FreeImage_DeInitialise")]
public static extern void DeInitialize();



// Version routines -------------------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetVersion")]
public static extern string GetVersion();

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetCopyrightMessage")]
public static extern string GetCopyrightMessage();



// Message Output routines ------------------------------------
// missing void FreeImage_OutputMessageProc(int fif,
// const char *fmt, ...);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_SetOutputMessage")]
public static extern void SetOutputMessage(FreeImage_OutputMessageFunction omf);



// Allocate/Clone/Unload routines -----------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_Allocate")]
public static extern FIBITMAP Allocate(int width, int height,
int bpp, uint red_mask, uint green_mask, uint blue_mask);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_AllocateT")]
public static extern FIBITMAP AllocateT(FIT ftype, int width,
int height, int bpp, uint red_mask, uint green_mask,
uint blue_mask);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Clone")]
public static extern FIBITMAP Clone(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Unload")]
public static extern void Unload(FIBITMAP dib);



// Load/Save routines -----------------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_Load")]
public static extern FIBITMAP Load(FIF format, string filename, int flags);

// missing FIBITMAP FreeImage_LoadFromHandle(FIF fif,
// FreeImageIO *io, fi_handle handle, int flags);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Save")]
public static extern bool Save(FIF format, FIBITMAP dib, string filename, int flags);

// missing BOOL FreeImage_SaveToHandle(FIF fif, FIBITMAP *dib,
// FreeImageIO *io, fi_handle handle, int flags);


// Plugin interface -------------------------------------------
// missing FIF FreeImage_RegisterLocalPlugin(FI_InitProc proc_address,
// const char *format, const char *description,
// const char *extension, const char *regexpr);
//
// missing FIF FreeImage_RegisterExternalPlugin(const char *path,
// const char *format, const char *description,
// const char *extension, const char *regexpr);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFCount")]
public static extern int GetFIFCount();

[DllImport("FreeImage.dll", EntryPoint="FreeImage_SetPluginEnabled")]
public static extern int SetPluginEnabled(FIF format, bool enabled);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_IsPluginEnabled")]
public static extern int IsPluginEnabled(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFFromFormat")]
public static extern FIF GetFIFFromFormat(string format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFFromMime")]
public static extern FIF GetFIFFromMime(string mime);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFormatFromFIF")]
public static extern string GetFormatFromFIF(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFExtensionList")]
public static extern string GetFIFExtensionList(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFDescription")]
public static extern string GetFIFDescription(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFRegExpr")]
public static extern string GetFIFRegExpr(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFIFFromFilename")]
public static extern FIF GetFIFFromFilename(string filename);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FIFSupportsReading")]
public static extern bool FIFSupportsReading(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FIFSupportsWriting")]
public static extern bool FIFSupportsWriting(FIF format);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FIFSupportsExportBPP")]
public static extern bool FIFSupportsExportBPP(FIF format, int bpp);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FIFSupportsExportType")]
public static extern bool FIFSupportsExportType(FIF format, FIT ftype);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FIFSupportsICCProfiles")]
public static extern bool FIFSupportsICCProfiles(FIF format, FIT ftype);



// Multipage interface ----------------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_OpenMultiBitmap")]
public static extern FIMULTIBITMAP OpenMultiBitmap(
FIF format, string filename, bool createNew, bool readOnly, bool keepCacheInMemory);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_CloseMultiBitmap")]
public static extern long CloseMultiBitmap(FIMULTIBITMAP bitmap, int flags);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetPageCount")]
public static extern int GetPageCount(FIMULTIBITMAP bitmap);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_AppendPage")]
public static extern void AppendPage(FIMULTIBITMAP bitmap, FIBITMAP data);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_InsertPage")]
public static extern void InsertPage(FIMULTIBITMAP bitmap, int page, FIBITMAP data);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_DeletePage")]
public static extern void DeletePage(FIMULTIBITMAP bitmap, int page);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_LockPage")]
public static extern FIBITMAP LockPage(FIMULTIBITMAP bitmap, int page);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_UnlockPage")]
public static extern void UnlockPage(FIMULTIBITMAP bitmap, int page, bool changed);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_MovePage")]
public static extern bool MovePage(FIMULTIBITMAP bitmap, int target, int source);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetLockedPageNumbers")]
public static extern bool GetLockedPageNumbers(FIMULTIBITMAP bitmap, IntPtr pages, IntPtr count);



// File type request routines ---------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetFileType")]
public static extern FIF GetFileType(string filename, int size);

// missing FIF FreeImage_GetFileTypeFromHandle(FreeImageIO *io,
// fi_handle handle, int size);

// Image type request routines --------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetImageType")]
public static extern FIT GetImageType(FIBITMAP dib);



// Info functions ---------------------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_IsLittleEndian")]
public static extern bool IsLittleEndian();



// Pixel access functions -------------------------------------
[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetBits")]
public static extern IntPtr GetBits(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetScanLine")]
public static extern IntPtr GetScanLine(FIBITMAP dib, int scanline);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetPixelIndex")]
public static extern bool GetPixelIndex(FIBITMAP dib, uint x, uint y, byte value);



[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetColorsUsed")]
public static extern uint GetColorsUsed(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetBPP")]
public static extern uint GetBPP(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetWidth")]
public static extern uint GetWidth(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetHeight")]
public static extern uint GetHeight(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetLine")]
public static extern uint GetLine(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetPitch")]
public static extern uint GetPitch(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetDIBSize")]
public static extern uint GetDIBSize(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetPalette")]
[return: MarshalAs(UnmanagedType.LPStruct)]
public static extern RGBQUAD GetPalette(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetDotsPerMeter")]
public static extern uint GetDotsPerMeterX(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetDotsPerMeterY")]
public static extern uint GetDotsPerMeterY(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetInfoHeader")]
[return: MarshalAs(UnmanagedType.LPStruct)]
public static extern BITMAPINFOHEADER GetInfoHeader(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetInfo")]
[return: MarshalAs(UnmanagedType.LPStruct)]
public static extern BITMAPINFO GetInfo(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetColorType")]
public static extern int GetColorType(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetRedMask")]
public static extern uint GetRedMask(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetGreenMask")]
public static extern uint GetGreenMask(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetBlueMask")]
public static extern uint GetBlueMask(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetTransparencyCount")]
public static extern uint GetTransparencyCount(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetTransparencyTable")]
public static extern IntPtr GetTransparencyTable(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_SetTransparent")]
public static extern void SetTransparent(FIBITMAP dib, bool enabled);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_IsTransparent")]
public static extern bool IsTransparent(FIBITMAP dib);





[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertTo8Bits")]
public static extern FIBITMAP ConvertTo8Bits(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertTo16Bits555")]
public static extern FIBITMAP ConvertTo16Bits555(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertTo16Bits565")]
public static extern FIBITMAP ConvertTo16Bits565(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertTo24Bits")]
public static extern FIBITMAP ConvertTo24Bits(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertTo32Bits")]
public static extern FIBITMAP ConvertTo32Bits(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="ColorQuantize")]
public static extern FIBITMAP ColorQuantize(FIBITMAP dib, FI_QUANTIZE quantize);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Threshold")]
public static extern FIBITMAP Threshold(FIBITMAP dib, uint t);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Dither")]
public static extern FIBITMAP Dither(FIBITMAP dib, FI_DITHER algorithm);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertFromRawBits")]
public static extern FIBITMAP ConvertFromRawBits(byte[] bits, int width, int height,
int pitch, uint bpp, uint redMask, uint greenMask, uint blueMask, bool topDown);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_ConvertToRawBits")]
public static extern void ConvertToRawBits(IntPtr bits, FIBITMAP dib, int pitch,
uint bpp, uint redMask, uint greenMask, uint blueMask, bool topDown);






[DllImport("FreeImage.dll", EntryPoint="FreeImage_RotateClassic")]
public static extern FIBITMAP RotateClassic(FIBITMAP dib, Double angle);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_RotateEx")]
public static extern FIBITMAP RotateEx(
FIBITMAP dib, Double angle, Double xShift, Double yShift, Double xOrigin, Double yOrigin, bool useMask);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FlipHorizontal")]
public static extern bool FlipHorizontal(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_FlipVertical")]
public static extern bool FlipVertical(FIBITMAP dib);



[DllImport("FreeImage.dll", EntryPoint="FreeImage_Rescale")]
public static extern FIBITMAP Rescale(FIBITMAP dib, int dst_width, int dst_height, FI_FILTER filter);



[DllImport("FreeImage.dll", EntryPoint="FreeImage_AdjustCurve")]
public static extern bool AdjustCurve(FIBITMAP dib, byte[] lut, FI_COLOR_CHANNEL channel);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_AdjustGamma")]
public static extern bool AdjustGamma(FIBITMAP dib, Double gamma);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_AdjustBrightness")]
public static extern bool AdjustBrightness(FIBITMAP dib, Double percentage);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_AdjustContrast")]
public static extern bool AdjustContrast(FIBITMAP dib, Double percentage);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Invert")]
public static extern bool Invert(FIBITMAP dib);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetHistogram")]
public static extern bool GetHistogram(FIBITMAP dib, int histo, FI_COLOR_CHANNEL channel);



[DllImport("FreeImage.dll", EntryPoint="FreeImage_GetChannel")]
public static extern bool GetChannel(FIBITMAP dib, FI_COLOR_CHANNEL channel);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_SetChannel")]
public static extern bool SetChannel(FIBITMAP dib, FIBITMAP dib8, FI_COLOR_CHANNEL channel);



[DllImport("FreeImage.dll", EntryPoint="FreeImage_Copy")]
public static extern FIBITMAP Copy(FIBITMAP dib, int left, int top, int right, int bottom);

[DllImport("FreeImage.dll", EntryPoint="FreeImage_Paste")]
public static extern bool Paste(FIBITMAP dst, FIBITMAP src, int left, int top, int alpha);
}
}

GeneralRe: C:\projects\SVGTest\SVG.cs(145): Argument '2': cannot convert from 'int' to 'uint' Pin
minorello5-Aug-05 3:46
minorello5-Aug-05 3:46 
GeneralRe: C:\projects\SVGTest\SVG.cs(145): Argument '2': cannot convert from 'int' to 'uint' Pin
David Boland5-Aug-05 5:53
David Boland5-Aug-05 5:53 
Generaland now FreeImaged.dll :( Pin
leoni5101-Jul-05 7:23
leoni5101-Jul-05 7:23 
GeneralRe: and now FreeImaged.dll :( Pin
David Boland1-Jul-05 7:35
David Boland1-Jul-05 7:35 
GeneralRe: and now FreeImaged.dll :( Pin
leoni5101-Jul-05 21:24
leoni5101-Jul-05 21:24 
GeneralRe: and now FreeImaged.dll :( Pin
alex_mp3-Dec-05 13:49
alex_mp3-Dec-05 13: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.