Ejemplo n.º 1
0
        /// <summary>
        /// Get Image from Raw Data
        /// </summary>
        /// <param name="data"></param>
        /// <param name="f">The FileFormat</param>
        /// <returns></returns>
        public static Image FromBytes(byte[] data, ImageFormat f)
        {
            var sel    = new ImageFormatSelector();
            var reader = sel.From(f);

            return(reader.Read(data));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Save the Image to specific FileFormat
        /// </summary>
        /// <param name="f"></param>
        /// <returns></returns>
        public byte[] Save(ImageFormat f)
        {
            var sel    = new ImageFormatSelector();
            var format = sel.From(f);

            return(format.Write(this));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get Image from Raw Data
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static Image FromBytes(byte[] data)
        {
            var sel    = new ImageFormatSelector();
            var reader = sel.From(data);

            return(reader.Read(data));

            /*var format = _selector.From(data);
             *
             * return format.Read(data);*/
        }