Skip to content

Commit

Permalink
Add VR path to remote response, allow image data to be skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
BOLL7708 committed Sep 2, 2024
1 parent 93d7302 commit 8760e23
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
16 changes: 11 additions & 5 deletions SuperScreenShotterVR/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,9 +571,13 @@ private void ScreenShotTaken(VREvent_Data_t eventData)
var resIndex = _settings.ResponseResolution;
var res = MainWindow.ResMap.Length > resIndex ? MainWindow.ResMap[resIndex] : 256;
if (res < 0) res = image.Width;
var bitmap = ResizeImage(image, res, res);
SetAlpha(ref bitmap, 255);
var imgb64data = GetBase64Bytes(bitmap);
var imgb64data = "";
if (res != 0)
{
var bitmap = ResizeImage(image, res, res);
SetAlpha(ref bitmap, 255);
imgb64data = GetBase64Bytes(bitmap);
}
if (msg != null)
{

Expand All @@ -584,7 +588,8 @@ private void ScreenShotTaken(VREvent_Data_t eventData)
imgb64data,
image.Width,
image.Height,
filePath
filePath,
filePathVr
),
JsonOptions.Get())
);
Expand All @@ -597,7 +602,8 @@ private void ScreenShotTaken(VREvent_Data_t eventData)
imgb64data,
image.Width,
image.Height,
filePath
filePath,
filePathVr
),
JsonOptions.Get())
);
Expand Down
1 change: 1 addition & 0 deletions SuperScreenShotterVR/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<ComboBoxItem>512px</ComboBoxItem>
<ComboBoxItem>1024px</ComboBoxItem>
<ComboBoxItem>Original</ComboBoxItem>
<ComboBoxItem>Skip</ComboBoxItem>
</ComboBox>
</StackPanel>

Expand Down
8 changes: 5 additions & 3 deletions SuperScreenShotterVR/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,15 @@ private void ComboBox_ScreenshotHotkey_SelectionChanged(object sender, Selection
_settings.Save();
UpdateHotkey(HotkeyIdScreenshot);
}
public static readonly int[] ResMap = {
public static readonly int[] ResMap =
[
128,
256,
512,
1024,
-1
};
-1,
0
];

private void CheckBox_ViewfinderHotkeyAlt_Checked(object sender, RoutedEventArgs e)
{
Expand Down
2 changes: 1 addition & 1 deletion SuperScreenShotterVR/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,6 @@
<value>..\resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Version" xml:space="preserve">
<value>v2.1.1</value>
<value>v2.2.0</value>
</data>
</root>
6 changes: 4 additions & 2 deletions SuperScreenShotterVR/Remote/ScreenshotResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ class ScreenshotResponse
public int Width = 0;
public int Height = 0;
public string FilePath = "";
public string FilePathVR = "";
public string Message = "";
public string Error = "";

public static ScreenshotResponse Create(string nonce, string image, int width, int height, string filePath)
public static ScreenshotResponse Create(string nonce, string image, int width, int height, string filePath, string filePathVR)
{
return new ScreenshotResponse()
{
Nonce = nonce,
Image = image,
Width = width,
Height = height,
FilePath = filePath
FilePath = filePath,
FilePathVR = filePathVR
};
}

Expand Down

0 comments on commit 8760e23

Please sign in to comment.