예제 #1
0
        /// <summary>
        /// 压缩应聘啊
        /// </summary>
        /// <param name="width">宽度(px)</param>
        /// <param name="height">高度(px)</param>
        /// <returns></returns>
        public Video Compress(int width, int height, Quality Quality)
        {
            var fname = Path.GetTempPath() + "pomelo_" + Guid.NewGuid().ToString().Replace("-", "") + Path.GetExtension(_Source);

            if (!MediaHelper.FormatConvert(Source, fname, width, height, Quality))
            {
                return(null);
            }
            var ret = new Video(fname);

            ret.IsTemp = true;
            return(ret);
        }
예제 #2
0
        /// <summary>
        /// 导出4K
        /// </summary>
        /// <returns></returns>
        public Video ExportTo4K()
        {
            var fname = Path.GetTempPath() + "pomelo_" + Guid.NewGuid().ToString().Replace("-", "") + Path.GetExtension(_Source);

            if (!MediaHelper.FormatConvert(Source, fname, System.Convert.ToInt32(Info.Width * 2160 / Info.Height), 2160, Quality.Best))
            {
                return(null);
            }
            var ret = new Video(fname);

            ret.IsTemp = true;
            return(ret);
        }
예제 #3
0
        /// <summary>
        /// 转换格式
        /// </summary>
        /// <param name="format">扩展名(带有点)</param>
        /// <returns></returns>
        public Video Convert(string format, Quality Quality)
        {
            var fname = Path.GetTempPath() + "pomelo_" + Guid.NewGuid().ToString().Replace("-", "") + format;

            if (!MediaHelper.FormatConvert(Source, fname, Quality))
            {
                return(null);
            }
            var ret = new Video(fname);

            ret.IsTemp = true;
            return(ret);
        }