示例#1
0
        /// <summary>Save the given image object&apos;s contents to an (image) file.
        /// The extension suffix on <c>file</c> will determine which saver module Evas is to use when saving, thus the final file&apos;s format. If the file supports multiple data stored in it (Eet ones), you can specify the key to be used as the index of the image in it.
        ///
        /// You can specify some flags when saving the image.  Currently acceptable flags are <c>quality</c> and <c>compress</c>. Eg.: &quot;quality=100 compress=9&quot;.
        /// (Since EFL 1.22)</summary>
        /// <param name="file">The filename to be used to save the image (extension obligatory).</param>
        /// <param name="key">The image key in the file (if an Eet one), or <c>null</c>, otherwise.</param>
        /// <param name="info">The flags to be used (<c>null</c> for defaults).</param>
        /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
        public bool Save(System.String file, System.String key, ref Efl.FileSaveInfo info)
        {
            Efl.FileSaveInfo.NativeStruct _in_info = info;
            var _ret_var = Efl.IFileSaveNativeInherit.efl_file_save_ptr.Value.Delegate(this.NativeHandle, file, key, ref _in_info);

            Eina.Error.RaiseIfUnhandledException();
            info = _in_info;
            return(_ret_var);
        }
示例#2
0
        private static bool save(System.IntPtr obj, System.IntPtr pd, System.String file, System.String key, ref Efl.FileSaveInfo.NativeStruct info)
        {
            Eina.Log.Debug("function efl_file_save was called");

            Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
            if (wrapper != null)
            {
                Efl.FileSaveInfo _in_info = info;
                bool             _ret_var = default(bool);
                try {
                    _ret_var = ((IFileSave)wrapper).Save(file, key, ref _in_info);
                } catch (Exception e) {
                    Eina.Log.Warning($"Callback error: {e.ToString()}");
                    Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
                }
                info = _in_info;
                return(_ret_var);
            }
            else
            {
                return(efl_file_save_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), file, key, ref info));
            }
        }