ImageUrl is a class for wrapping url that is get from external buffer.
it is used for lifecycle management of external buffers.
public static extern IntPtr GetNativeImageSourcePtr(HandleRef jarg1);
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_GenerateUrl")]
- public static extern string GenerateUrl(HandleRef capture);
+ public static extern IntPtr GenerateUrl(HandleRef capture);
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Capture_GetCapturedBuffer")]
public static extern IntPtr GetCapturedBuffer(HandleRef capture);
--- /dev/null
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+namespace Tizen.NUI
+{
+ using global::System;
+ using global::System.Runtime.InteropServices;
+
+ internal static partial class Interop
+ {
+ internal static partial class ImageUrl
+ {
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ImageUrl")]
+ public static extern void Delete(HandleRef jarg1);
+
+ [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ImageUrl_Get")]
+ public static extern string GetUrl(HandleRef jarg1);
+ }
+ }
+}
public static extern bool ReleaseBuffer(IntPtr jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_NativeImageSource_GenerateUrl")]
- public static extern string GenerateUrl(IntPtr handle);
+ public static extern IntPtr GenerateUrl(IntPtr handle);
}
}
}
public static extern int GetPixelFormat(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_PixelData_GenerateUrl")]
- public static extern string GenerateUrl(global::System.IntPtr handle);
+ public static extern global::System.IntPtr GenerateUrl(global::System.IntPtr handle);
}
}
}
{
IntPtr bufferIntPtr = Interop.WebHitTest.GetImageBuffer(SwigCPtr);
PixelData pixelData = new PixelData(bufferIntPtr, true);
- ImageView image = new ImageView(pixelData.Url);
+ ImageUrl url = pixelData.GenerateUrl();
+ ImageView image = new ImageView(url.ToString());
image.Size = new Size(pixelData.GetWidth(), pixelData.GetHeight());
pixelData.Dispose();
return image;
--- /dev/null
+/*
+ * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+using System;
+using System.ComponentModel;
+
+namespace Tizen.NUI
+{
+ using global::System;
+ using global::System.ComponentModel;
+ using global::System.Runtime.InteropServices;
+ using Tizen.NUI.BaseComponents;
+
+ /// <summary>
+ /// Url for Image
+ /// </summary>
+ /// <remarks>Hidden API: Only for inhouse or developing usage. The behavior and interface can be changed anytime.</remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class ImageUrl : BaseHandle
+ {
+ internal ImageUrl(IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ /// <summary>
+ /// Dispose
+ /// </summary>
+ /// <param name="type"></param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+ }
+
+ base.Dispose(type);
+ }
+
+ /// This will not be public opened.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected override void ReleaseSwigCPtr(HandleRef swigCPtr)
+ {
+ Interop.ImageUrl.Delete(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override string ToString()
+ {
+ string ret = Interop.ImageUrl.GetUrl(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+}
}
/// <summary>
- /// Get URI from native image source.
+ /// Generate Url from native image source.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public string Url
+ public ImageUrl GenerateUrl()
{
- get
- {
- string uri = "";
- uri = Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
- return uri;
- }
+ ImageUrl ret = new ImageUrl(Interop.NativeImageSource.GenerateUrl(this.SwigCPtr.Handle), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+ return ret;
}
[EditorBrowsable(EditorBrowsableState.Never)]
}
/// <summary>
- /// Get URI from pixel data.
+ /// Generate Url from pixel data.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
- public string Url
+ public ImageUrl GenerateUrl()
{
- get
- {
- string Uri = "";
- Uri = Interop.PixelData.GenerateUrl(this.SwigCPtr.Handle);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
- return Uri;
- }
+ ImageUrl ret = new ImageUrl(Interop.PixelData.GenerateUrl(this.SwigCPtr.Handle), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
+ return ret;
}
/// <summary>