コード例 #1
0
        public static string GetImageUrlPath(PreDefImageLocation loc)
        {
            switch (loc)
            {
            case PreDefImageLocation.GameImage:
                return(@"Content/images/Uploads/GameImage/");

            case PreDefImageLocation.QuestionImage:
                return(@"Content/images/Uploads/QuestionImage/");

            default:
                break;
            }
            return("");
        }
コード例 #2
0
        public static string GetDefaultImageLocation(PreDefImageLocation preDefImageLocation)
        {
            switch (preDefImageLocation)
            {
            case PreDefImageLocation.GameImage:
                return("\\GameImage\\");

            case PreDefImageLocation.QuestionImage:
                return("\\QuestionImage\\");

            default:
                break;
            }
            return("");
        }
コード例 #3
0
 public static UploadHandler UploadImage(HttpPostedFileBase imageFile, Point size, PreDefImageLocation location)
 {
     if (FileIsImage(imageFile))
     {
         UploadHandler uploadFile = new UploadHandler(imageFile, FileType.Image);
         uploadFile.Size        = size;
         uploadFile.ImageFolder = GetDefaultImageLocation(location);
         return(Upload(uploadFile));
     }
     return(null);
 }