resizing
This commit is contained in:
parent
87f56d55de
commit
7387b2c777
@ -1,7 +1,4 @@
|
||||
using ComputeSharp;
|
||||
using System.Xml.Linq;
|
||||
using Windows.Devices.Geolocation;
|
||||
using static Cupola.Program;
|
||||
|
||||
namespace Cupola
|
||||
{
|
||||
@ -110,10 +107,15 @@ namespace Cupola
|
||||
return outputImages;
|
||||
}
|
||||
|
||||
private static ReadWriteTexture2D<Bgra32, float4>[] Load(string dir)
|
||||
public static ReadWriteTexture2D<Bgra32, float4>[] Load(string dir)
|
||||
{
|
||||
string[] files = Directory.GetFiles(dir);
|
||||
|
||||
return Load(files);
|
||||
}
|
||||
|
||||
public static ReadWriteTexture2D<Bgra32, float4>[] Load(string[] files)
|
||||
{
|
||||
ReadWriteTexture2D<Bgra32, float4>[] images = new ReadWriteTexture2D<Bgra32, Float4>[files.Length];
|
||||
|
||||
for (int i = 0; i < files.Length; i++)
|
||||
|
@ -5,15 +5,30 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Tranquility"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="539">
|
||||
Title="Tranquility" Height="450" Width="539">
|
||||
<Grid>
|
||||
<Button Content="Load" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="65" Click="LoadFilesClick"/>
|
||||
<Button Content="Run" HorizontalAlignment="Left" Margin="249,10,0,0" VerticalAlignment="Top" Height="35" Width="65"/>
|
||||
<Button Content="Save" HorizontalAlignment="Left" Margin="249,389,0,0" VerticalAlignment="Top" Height="35" Width="280"/>
|
||||
<ProgressBar HorizontalAlignment="Left" Height="35" Margin="319,10,0,0" VerticalAlignment="Top" Width="210"/>
|
||||
<TextBox HorizontalAlignment="Left" Margin="80,10,0,0" TextWrapping="Wrap" Text="INPUT FOLDER" VerticalAlignment="Top" Width="164" Height="35"/>
|
||||
<TextBox HorizontalAlignment="Left" Margin="10,50,0,0" TextWrapping="Wrap" Text="INPUT FILES" VerticalAlignment="Top" Width="234" Height="374"/>
|
||||
<Image HorizontalAlignment="Left" Height="332" Margin="249,50,0,0" VerticalAlignment="Top" Width="281"/>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid x:Name="Left" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Height="NaN" Margin="0,0,0,0" VerticalAlignment="Stretch" Width="NaN">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="Load" Content="Load" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="65" Click="LoadFilesClick"/>
|
||||
<TextBox x:Name="Input_Folder" Margin="80,10,10,0" TextWrapping="Wrap" Text="INPUT FOLDER" VerticalAlignment="Top" Height="35"/>
|
||||
<TextBox x:Name="Input_Files" TextWrapping="Wrap" Text="INPUT FILES" Margin="10,50,10,10"/>
|
||||
</Grid>
|
||||
<Grid x:Name="Right" Grid.ColumnSpan="2" Height="NaN" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="NaN">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button x:Name="Run" Content="Run" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Height="35" Width="64" Grid.Column="1"/>
|
||||
<ProgressBar x:Name="Progress" Height="35" Margin="78,10,10,0" VerticalAlignment="Top" Grid.Column="1"/>
|
||||
<Image x:Name="Preview" Grid.Column="1" Margin="12,53,12,56"/>
|
||||
<Button x:Name="Save" Content="Save" Margin="10,0,10,10" Grid.Column="1" Height="35" VerticalAlignment="Bottom"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
@ -1,6 +1,8 @@
|
||||
using System.Windows;
|
||||
using Microsoft.WindowsAPICodePack.Dialogs;
|
||||
using WinRT;
|
||||
using Cupola;
|
||||
using System.IO;
|
||||
|
||||
namespace Tranquility
|
||||
{
|
||||
@ -9,6 +11,8 @@ namespace Tranquility
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
string[]? files;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
@ -16,7 +20,9 @@ namespace Tranquility
|
||||
|
||||
private void LoadFilesClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string file = OpenFolder();
|
||||
string file = OpenFolder();
|
||||
|
||||
files = Directory.GetFiles(file);
|
||||
}
|
||||
|
||||
private static string? OpenFolder()
|
||||
|
Loading…
Reference in New Issue
Block a user