Option to copy VRC images

This commit is contained in:
Natsumi
2023-11-22 02:06:47 +13:00
parent 2febfab962
commit 29b5bedde1
5 changed files with 62 additions and 35 deletions
+6 -1
View File
@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
@@ -453,7 +454,11 @@ namespace VRCX
MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
{
var image = Image.FromFile(path);
Clipboard.SetImage(image);
// Clipboard.SetImage(image);
var data = new DataObject();
data.SetData(DataFormats.Bitmap, image);
data.SetFileDropList(new StringCollection { path });
Clipboard.SetDataObject(data, true);
}));
}
}
+3 -2
View File
@@ -19,11 +19,11 @@ namespace VRCX
/// <param name="metadataString">The metadata to add to the screenshot file.</param>
/// <param name="worldId">The ID of the world to associate with the screenshot.</param>
/// <param name="changeFilename">Whether or not to rename the screenshot file to include the world ID.</param>
public void AddScreenshotMetadata(string path, string metadataString, string worldId, bool changeFilename = false)
public string AddScreenshotMetadata(string path, string metadataString, string worldId, bool changeFilename = false)
{
var fileName = Path.GetFileNameWithoutExtension(path);
if (!File.Exists(path) || !path.EndsWith(".png") || !fileName.StartsWith("VRChat_"))
return;
return string.Empty;
if (changeFilename)
{
@@ -34,6 +34,7 @@ namespace VRCX
}
ScreenshotHelper.WritePNGDescription(path, metadataString);
return path;
}
/// <summary>