C# Class JustPressPlay.Utilities.JPPImage

Datei anzeigen Open project: RIT-MAGIC/JustPressPlay

Public Methods

Method Description
FileIsWebFriendlyImage ( Stream stream ) : bool

Checks to make sure the image uploaded is one of the approved types (.png, .gif, .jpg)

GetIconFileNames ( ) : List

Gets the achievement/quest icon file names in the system, WITHOUT extensions

Save ( System.Web.HttpServerUtilityBase serverUtilityBase, string filePath, Stream stream, int maxSideSize, int minSideSize, bool makeItSquare ) : void

Resizes and saves the image to the specified location

SaveAchievementIcons ( string newFileNameAndPath, string iconNameNoExt, int create, int explore, int learn, int socialize ) : bool

Saves the three achievement icons

SaveImageAtSquareSize ( string filePath, Image originalImage, int size, ImageSaveInfo info ) : void

Saves an image (from a stream) at a specific size

SavePlayerImages ( string filePath, string fileNameNoExt, Stream stream ) : System.Boolean

Saves the three player images

SavePlayerQRCodes ( string filePath, string fileNameNoExt, string qrString ) : System.Boolean

Saves the three player qrcodes

SaveQuestIcons ( string newFileNameAndPath, string iconNameNoExt, bool userGeneratedQuest ) : System.Boolean

Saves the three quest icons

Method Details

FileIsWebFriendlyImage() public static method

Checks to make sure the image uploaded is one of the approved types (.png, .gif, .jpg)
public static FileIsWebFriendlyImage ( Stream stream ) : bool
stream Stream
return bool

GetIconFileNames() public static method

Gets the achievement/quest icon file names in the system, WITHOUT extensions
public static GetIconFileNames ( ) : List
return List

Save() public static method

Resizes and saves the image to the specified location
public static Save ( System.Web.HttpServerUtilityBase serverUtilityBase, string filePath, Stream stream, int maxSideSize, int minSideSize, bool makeItSquare ) : void
serverUtilityBase System.Web.HttpServerUtilityBase
filePath string
stream Stream The bytes for the image passed in
maxSideSize int Maximum image width
minSideSize int
makeItSquare bool Whether or not to make the image a square
return void

SaveAchievementIcons() public static method

Saves the three achievement icons
public static SaveAchievementIcons ( string newFileNameAndPath, string iconNameNoExt, int create, int explore, int learn, int socialize ) : bool
newFileNameAndPath string The file and path for saving the images
iconNameNoExt string The icon name without extension
create int Create points for the achievement
explore int Explore points for the achievement
learn int Learn points for the achievement
socialize int Socialize points for the achievement
return bool

SaveImageAtSquareSize() public static method

Saves an image (from a stream) at a specific size
public static SaveImageAtSquareSize ( string filePath, Image originalImage, int size, ImageSaveInfo info ) : void
filePath string The file name and path for saving
originalImage Image
size int The size for saving
info ImageSaveInfo
return void

SavePlayerImages() public static method

Saves the three player images
public static SavePlayerImages ( string filePath, string fileNameNoExt, Stream stream ) : System.Boolean
filePath string The file path (no file name)
fileNameNoExt string The file name without extension
stream Stream The image stream
return System.Boolean

SavePlayerQRCodes() public static method

Saves the three player qrcodes
public static SavePlayerQRCodes ( string filePath, string fileNameNoExt, string qrString ) : System.Boolean
filePath string The file path (no file name)
fileNameNoExt string The file name without extension
qrString string
return System.Boolean

SaveQuestIcons() public static method

Saves the three quest icons
public static SaveQuestIcons ( string newFileNameAndPath, string iconNameNoExt, bool userGeneratedQuest ) : System.Boolean
newFileNameAndPath string The file and path for saving the images
iconNameNoExt string The icon name without extension
userGeneratedQuest bool Is this a user generated quest?
return System.Boolean