Added some fixes for the IDestination code, allowing a Destination to supply dynamics without base. Also made the savetmpfile able to store in a supplied path.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2037 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-09-14 16:43:15 +00:00
parent c037b99d6e
commit 203a34ee6f
7 changed files with 52 additions and 24 deletions

View file

@ -350,11 +350,14 @@ namespace Greenshot.Helpers {
/// </summary>
/// <param name="image"></param>
/// <returns></returns>
public static string SaveToTmpFile(Image image, OutputSettings outputSettings) {
public static string SaveToTmpFile(Image image, OutputSettings outputSettings, string destinationPath) {
string tmpFile = Path.GetRandomFileName() + "." + outputSettings.Format.ToString();
// Prevent problems with "other characters", which could cause problems
tmpFile = Regex.Replace(tmpFile, @"[^\d\w\.]", "");
string tmpPath = Path.Combine(Path.GetTempPath(), tmpFile);
if (destinationPath == null) {
destinationPath = Path.GetTempPath();
}
string tmpPath = Path.Combine(destinationPath, tmpFile);
LOG.Debug("Creating TMP File : " + tmpPath);
try {