mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
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:
parent
c037b99d6e
commit
203a34ee6f
7 changed files with 52 additions and 24 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue