Ejemplo n.º 1
0
        /// <summary>
        /// Construct a new MIME / Image record based on a stream.
        /// </summary>
        /// <param name="imgStream">Reference to a stream containing image data
        /// (encoded for example as a PNG or JPEG). The stream will be parsed
        /// by this class, to load its contents into the Payload of this record
        /// and set the MIME type correctly depending on the stream contents.</param>
        /// <returns>A newly constructed MIME / Image record with the stream data
        /// as payload and the MIME type automatically determined based on the
        /// image data.</returns>
        public static async Task <NdefMimeImageRecord> CreateFromStream(IRandomAccessStream imgStream)
        {
            var imgRecord = new NdefMimeImageRecord();
            await imgRecord.LoadStream(imgStream);

            return(imgRecord);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Construct a new MIME / Image record based on a stream.
 /// </summary>
 /// <param name="imgStream">Reference to a stream containing image data
 /// (encoded for example as a PNG or JPEG). The stream will be parsed
 /// by this class, to load its contents into the Payload of this record
 /// and set the MIME type correctly depending on the stream contents.</param>
 /// <returns>A newly constructed MIME / Image record with the stream data
 /// as payload and the MIME type automatically determined based on the 
 /// image data.</returns>
 public static async Task<NdefMimeImageRecord> CreateFromStream(IRandomAccessStream imgStream)
 {
     var imgRecord = new NdefMimeImageRecord();
     await imgRecord.LoadStream(imgStream);
     return imgRecord;
 }