How can I write the same code in xamarin :
CGDataProviderRef provider = CGDataProviderCreateWithData(nil, newImageData, newLength, nil);
Here is a assembly code :
[DllImport ("/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/CoreGraphics")] private static extern IntPtr CGDataProviderCreateWithData (IntPtr info, IntPtr data, nint size, CGDataProvider.CGDataProviderReleaseDataCallback releaseData);
I tried to import this method like this :
DllImport (Constants.ApplicationServicesCoreGraphicsLibrary)] private static extern IntPtr CGDataProviderCreateWithData (IntPtr info, IntPtr data,nint size /*fourth param*/);
I have two questions
what should I pass as fourth param (CGDataProviderReleaseDataCallback is private member)?
how to cast IntPtr in CGDataProvider ?