//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
#nullable restore
using System;
using System.Collections.Generic;
using Android.Runtime;
using Java.Interop;
namespace Com.Hdl.Hdllinphonesdk.Utils {
// Metadata.xml XPath class reference: path="/api/package[@name='com.hdl.hdllinphonesdk.utils']/class[@name='HDLImageUtils']"
[global::Android.Runtime.Register ("com/hdl/hdllinphonesdk/utils/HDLImageUtils", DoNotGenerateAcw=true)]
public partial class HDLImageUtils : global::Java.Lang.Object {
static readonly JniPeerMembers _members = new XAPeerMembers ("com/hdl/hdllinphonesdk/utils/HDLImageUtils", typeof (HDLImageUtils));
internal static IntPtr class_ref {
get { return _members.JniPeerType.PeerReference.Handle; }
}
[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
public override global::Java.Interop.JniPeerMembers JniPeerMembers {
get { return _members; }
}
[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
protected override IntPtr ThresholdClass {
get { return _members.JniPeerType.PeerReference.Handle; }
}
[global::System.Diagnostics.DebuggerBrowsable (global::System.Diagnostics.DebuggerBrowsableState.Never)]
[global::System.ComponentModel.EditorBrowsable (global::System.ComponentModel.EditorBrowsableState.Never)]
protected override global::System.Type ThresholdType {
get { return _members.ManagedPeerType; }
}
protected HDLImageUtils (IntPtr javaReference, JniHandleOwnership transfer) : base (javaReference, transfer)
{
}
// Metadata.xml XPath constructor reference: path="/api/package[@name='com.hdl.hdllinphonesdk.utils']/class[@name='HDLImageUtils']/constructor[@name='HDLImageUtils' and count(parameter)=0]"
[Register (".ctor", "()V", "")]
public unsafe HDLImageUtils () : base (IntPtr.Zero, JniHandleOwnership.DoNotTransfer)
{
const string __id = "()V";
if (((global::Java.Lang.Object) this).Handle != IntPtr.Zero)
return;
try {
var __r = _members.InstanceMethods.StartCreateInstance (__id, ((object) this).GetType (), null);
SetHandle (__r.Handle, JniHandleOwnership.TransferLocalRef);
_members.InstanceMethods.FinishCreateInstance (__id, this, null);
} finally {
}
}
// Metadata.xml XPath method reference: path="/api/package[@name='com.hdl.hdllinphonesdk.utils']/class[@name='HDLImageUtils']/method[@name='byteToBitmap' and count(parameter)=1 and parameter[1][@type='byte[]']]"
[Register ("byteToBitmap", "([B)Landroid/graphics/Bitmap;", "")]
public static unsafe global::Android.Graphics.Bitmap ByteToBitmap (byte[] imgByte)
{
const string __id = "byteToBitmap.([B)Landroid/graphics/Bitmap;";
IntPtr native_imgByte = JNIEnv.NewArray (imgByte);
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [1];
__args [0] = new JniArgumentValue (native_imgByte);
var __rm = _members.StaticMethods.InvokeObjectMethod (__id, __args);
return global::Java.Lang.Object.GetObject (__rm.Handle, JniHandleOwnership.TransferLocalRef);
} finally {
if (imgByte != null) {
JNIEnv.CopyArray (native_imgByte, imgByte);
JNIEnv.DeleteLocalRef (native_imgByte);
}
global::System.GC.KeepAlive (imgByte);
}
}
// Metadata.xml XPath method reference: path="/api/package[@name='com.hdl.hdllinphonesdk.utils']/class[@name='HDLImageUtils']/method[@name='saveImageToGallery' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='android.graphics.Bitmap']]"
[Register ("saveImageToGallery", "(Landroid/content/Context;Landroid/graphics/Bitmap;)Z", "")]
public static unsafe bool SaveImageToGallery (global::Android.Content.Context context, global::Android.Graphics.Bitmap bitmap)
{
const string __id = "saveImageToGallery.(Landroid/content/Context;Landroid/graphics/Bitmap;)Z";
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [2];
__args [0] = new JniArgumentValue ((context == null) ? IntPtr.Zero : ((global::Java.Lang.Object) context).Handle);
__args [1] = new JniArgumentValue ((bitmap == null) ? IntPtr.Zero : ((global::Java.Lang.Object) bitmap).Handle);
var __rm = _members.StaticMethods.InvokeBooleanMethod (__id, __args);
return __rm;
} finally {
global::System.GC.KeepAlive (context);
global::System.GC.KeepAlive (bitmap);
}
}
// Metadata.xml XPath method reference: path="/api/package[@name='com.hdl.hdllinphonesdk.utils']/class[@name='HDLImageUtils']/method[@name='saveImageToGallery' and count(parameter)=2 and parameter[1][@type='android.content.Context'] and parameter[2][@type='byte[]']]"
[Register ("saveImageToGallery", "(Landroid/content/Context;[B)Z", "")]
public static unsafe bool SaveImageToGallery (global::Android.Content.Context context, byte[] image_bytes)
{
const string __id = "saveImageToGallery.(Landroid/content/Context;[B)Z";
IntPtr native_image_bytes = JNIEnv.NewArray (image_bytes);
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [2];
__args [0] = new JniArgumentValue ((context == null) ? IntPtr.Zero : ((global::Java.Lang.Object) context).Handle);
__args [1] = new JniArgumentValue (native_image_bytes);
var __rm = _members.StaticMethods.InvokeBooleanMethod (__id, __args);
return __rm;
} finally {
if (image_bytes != null) {
JNIEnv.CopyArray (native_image_bytes, image_bytes);
JNIEnv.DeleteLocalRef (native_image_bytes);
}
global::System.GC.KeepAlive (context);
global::System.GC.KeepAlive (image_bytes);
}
}
// Metadata.xml XPath method reference: path="/api/package[@name='com.hdl.hdllinphonesdk.utils']/class[@name='HDLImageUtils']/method[@name='saveSignImage' and count(parameter)=3 and parameter[1][@type='android.content.Context'] and parameter[2][@type='java.lang.String'] and parameter[3][@type='android.graphics.Bitmap']]"
[Register ("saveSignImage", "(Landroid/content/Context;Ljava/lang/String;Landroid/graphics/Bitmap;)V", "")]
public static unsafe void SaveSignImage (global::Android.Content.Context context, string fileName, global::Android.Graphics.Bitmap bitmap)
{
const string __id = "saveSignImage.(Landroid/content/Context;Ljava/lang/String;Landroid/graphics/Bitmap;)V";
IntPtr native_fileName = JNIEnv.NewString ((string)fileName);
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [3];
__args [0] = new JniArgumentValue ((context == null) ? IntPtr.Zero : ((global::Java.Lang.Object) context).Handle);
__args [1] = new JniArgumentValue (native_fileName);
__args [2] = new JniArgumentValue ((bitmap == null) ? IntPtr.Zero : ((global::Java.Lang.Object) bitmap).Handle);
_members.StaticMethods.InvokeVoidMethod (__id, __args);
} finally {
JNIEnv.DeleteLocalRef (native_fileName);
global::System.GC.KeepAlive (context);
global::System.GC.KeepAlive (bitmap);
}
}
}
}