Use variable folder path for draw image effect

This commit is contained in:
Jaex 2020-05-14 00:18:27 +03:00
parent aad09c59a1
commit ee6d85cf1a
4 changed files with 9 additions and 3 deletions

View file

@ -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;
}
}

View file

@ -42,7 +42,7 @@ public override object EditValue(ITypeDescriptorContext context, IServiceProvide
if (!string.IsNullOrEmpty(filePath))
{
value = filePath;
value = Helpers.GetVariableFolderPath(filePath);
}
return value;

View file

@ -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)
{

View file

@ -188,6 +188,7 @@ public string GetLocalhostPath(string fileName)
{
return "";
}
return Path.Combine(Path.Combine(Helpers.ExpandFolderVariables(LocalhostRoot), GetSubFolderPath()), fileName);
}