mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Use variable folder path for draw image effect
This commit is contained in:
parent
aad09c59a1
commit
ee6d85cf1a
4 changed files with 9 additions and 3 deletions
|
@ -38,14 +38,17 @@ public override object EditValue(ITypeDescriptorContext context, IServiceProvide
|
|||
{
|
||||
return base.EditValue(context, provider, value);
|
||||
}
|
||||
|
||||
using (FolderSelectDialog dlg = new FolderSelectDialog())
|
||||
{
|
||||
dlg.Title = Resources.DirectoryNameEditor_EditValue_Browse_for_a_folder___;
|
||||
|
||||
if (dlg.ShowDialog())
|
||||
{
|
||||
value = Helpers.GetVariableFolderPath(dlg.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public override object EditValue(ITypeDescriptorContext context, IServiceProvide
|
|||
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
{
|
||||
value = filePath;
|
||||
value = Helpers.GetVariableFolderPath(filePath);
|
||||
}
|
||||
|
||||
return value;
|
||||
|
|
|
@ -59,9 +59,11 @@ public DrawImage()
|
|||
|
||||
public override Bitmap Apply(Bitmap bmp)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ImageLocation) && File.Exists(ImageLocation))
|
||||
string imageFilePath = Helpers.ExpandFolderVariables(ImageLocation);
|
||||
|
||||
if (!string.IsNullOrEmpty(imageFilePath) && File.Exists(imageFilePath))
|
||||
{
|
||||
using (Bitmap bmp2 = ImageHelpers.LoadImage(ImageLocation))
|
||||
using (Bitmap bmp2 = ImageHelpers.LoadImage(imageFilePath))
|
||||
{
|
||||
if (bmp2 != null)
|
||||
{
|
||||
|
|
|
@ -188,6 +188,7 @@ public string GetLocalhostPath(string fileName)
|
|||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return Path.Combine(Path.Combine(Helpers.ExpandFolderVariables(LocalhostRoot), GetSubFolderPath()), fileName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue