cocoa native method (CGDataProviderCreateWithData) using in xamarin

NinineaNininea USUniversity ✭✭✭

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 ?

Tagged:

Best Answer

  • NinineaNininea US ✭✭✭
    Accepted Answer

    Ignore question !

    p.s. you can use CGDataProviderCreateWithData is transformed as constructor.

Answers

  • NinineaNininea USUniversity ✭✭✭
    Accepted Answer

    Ignore question !

    p.s. you can use CGDataProviderCreateWithData is transformed as constructor.

Sign In or Register to comment.