示例#1
0
文件: Image.cs 项目: furesoft/FureOS
        /// <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));
        }
示例#2
0
文件: Image.cs 项目: furesoft/FureOS
        /// <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));
        }
示例#3
0
文件: Image.cs 项目: furesoft/FureOS
        /// <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);*/
        }