コード例 #1
0
        /// <summary>
        /// Returns the data for the specified image in JPEG format.
        /// </summary>
        /// <returns>The image JPEG representation.</returns>
        /// <param name="image">The original image data.</param>
        /// <param name="compressionQuality">The quality of the resulting JPEG image,
        /// expressed as a value from 0.0 to 1.0. The value 0.0 represents the maximum compression
        /// (or lowest quality) while the value 1.0 represents the least compression (or best quality).</param>
        public static byte[] UIImageJPEGRepresentation(UIImage image, float compressionQuality)
        {
            if (image == null)
            {
                return(null);
            }

            compressionQuality = UnityEngine.Mathf.Clamp(compressionQuality, 0, 1);
            return(PInvokeUtil.GetNativeArray <byte>((buffer, length) =>
                                                     C.UIImage_JPEGRepresentation(image.SelfPtr(), compressionQuality, buffer, length)));
        }
コード例 #2
0
ファイル: iOSSavedGameNative.cs プロジェクト: artemy0/Quiz
 internal byte[] GetData()
 {
     return(PInvokeUtil.GetNativeArray <byte>((buffer, length) =>
                                              _LoadSavedGameDataResponse_GetData(SelfPtr(), buffer, length)));
 }
コード例 #3
0
 public byte[] GetJPEGData(float compressionQuality)
 {
     compressionQuality = UnityEngine.Mathf.Clamp(compressionQuality, 0, 1);
     return(PInvokeUtil.GetNativeArray <byte>((buffer, length) =>
                                              _InteropUIImage_GetJPEGData(SelfPtr(), compressionQuality, buffer, length)));
 }
コード例 #4
0
 public byte[] GetPNGData()
 {
     return(PInvokeUtil.GetNativeArray <byte>((buffer, length) =>
                                              _InteropUIImage_GetPNGData(SelfPtr(), buffer, length)));
 }
コード例 #5
0
 /// <summary>
 /// Returns the data for the specified image in PNG format.
 /// </summary>
 /// <returns>The image PNG representation.</returns>
 /// <param name="image">The original image data.</param>
 public static byte[] UIImagePNGRepresentation(UIImage image)
 {
     return(image == null ? null : PInvokeUtil.GetNativeArray <byte>((buffer, length) =>
                                                                     C.UIImage_PNGRepresentation(image.SelfPtr(), buffer, length)));
 }