Ejemplo n.º 1
0
        /// <summary>
        /// Construct a new MIME / Image record based on a file.
        /// </summary>
        /// <param name="file">Reference to a file that will be opened and parsed
        /// by this class, to load its contents into the Payload of this record
        /// and set the MIME type correctly depending on the file contents.</param>
        /// <returns>A newly constructed MIME / Image record with the file data
        /// as payload and the MIME type automatically determined based on the
        /// image data.</returns>
        public static async Task <NdefMimeImageRecord> CreateFromFile(StorageFile file)
        {
            var imgRecord = new NdefMimeImageRecord();
            await imgRecord.LoadFile(file);

            return(imgRecord);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Construct a new MIME / Image record based on a file.
 /// </summary>
 /// <param name="file">Reference to a file that will be opened and parsed
 /// by this class, to load its contents into the Payload of this record
 /// and set the MIME type correctly depending on the file contents.</param>
 /// <returns>A newly constructed MIME / Image record with the file data
 /// as payload and the MIME type automatically determined based on the 
 /// image data.</returns>
 public static async Task<NdefMimeImageRecord> CreateFromFile(StorageFile file)
 {
     var imgRecord = new NdefMimeImageRecord();
     await imgRecord.LoadFile(file);
     return imgRecord;
 }