AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 2004

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2004.03.09 17:58 "C# Wrapper", by <maillist@iter.dk>
2004.03.09 19:03 "Re: C# Wrapper", by Bob Friesenhahn

2004.03.09 19:03 "Re: C# Wrapper", by Bob Friesenhahn

On Tue, 9 Mar 2004, maillist@iter.dk wrote:

> Has anyone got a C# wrapper for the libtiff library?
>
> I have managed to wrap a few of the functions, but have problems with
> wrapping _TIFFmalloc, since I
> don't know how to handle the void* type that is returned.

The easiest way to create a C# wrapper is by implementing it in C++,
and expose the interfaces as a class by using "Managed C++".  The
void* type is a native type in C++.  For safety's sake, C# shouldn't
be exposed to C pointers.  In fact, the .NET run-time will not allow
managed code (i.e. C#) to access data allocated from the C/C++ heap.
It is not difficult to marshal raw image data into the GDI+ image
representation used by C#.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us
http://www.simplesystems.org/users/bfriesen