I'm using a third party C based DLL for some image manipulation.
I've noticed that my original wrapper class doesn't implement iDisposable, thus I cannot dispose the utility class at will.
I've trying to find a sample that will help me put this last piece in it's place but I'm unable to find any reference.
This is how this DLL is defined and used
Expand|Select|Wrap|Line Numbers
- public sealed class ManipulateImageWrapper: IDisposable {
- [DllImport("manipulateImage.dll", EntryPoint="ManipulateBitmap")]
- static extern Byte ManipulatrBitmap(IntPtr Bitmap1);
- public string ImageManipulate(Bitmap iImage1) {
- return (ManipulatrBitmap(iImage1.GetHbitmap()).ToString();
- }
- #region IDisposable Members
- public void Dispose() {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
- private void Dispose(bool disposing) {
- [This is the part I'm missing, how to dispose "manipulateImage.dll"]
- }
- ~ImageCompareWrapper() {
- Dispose(false);
- }
- #endregion
Dror