예제 #1
0
        public static void MakeThumb(string srcimageUrl, string fileName, ThumbImage thumbSize)
        {
            using (Image img = MakeThumb(Bitmap.FromFile(srcimageUrl), new Size(thumbSize.Width, thumbSize.Height)))
            {
                fileName = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory.Replace("\\", "/"), thumbSize.ImageFoler), fileName);

                if (!Directory.Exists(Path.GetDirectoryName(fileName)))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(fileName));
                }

                img.Save(fileName);
            }
        }
예제 #2
0
        public static void MakeThumb(string srcimageUrl, string fileName, ThumbImage thumbSize)
        {
            using (Image img = MakeThumb(Bitmap.FromFile(srcimageUrl), new Size(thumbSize.Width, thumbSize.Height)))
            {
                fileName = Path.Combine(Path.Combine(AppDomain.CurrentDomain.BaseDirectory.Replace("\\", "/"), thumbSize.ImageFoler), fileName);

                if (!Directory.Exists(Path.GetDirectoryName(fileName)))
                {
                    Directory.CreateDirectory(Path.GetDirectoryName(fileName));
                }

                img.Save(fileName);
            }
        }