Browse Source

use arrows to flip through loaded images

main
Colin McMillen 1 year ago
parent
commit
6fc66aba8f
  1. 14
      Program.cs

14
Program.cs

@ -128,7 +128,7 @@ public class Texture : IDisposable {
public Texture(string path) {
Image<Rgba32> image = Image.Load<Rgba32>(path);
Console.WriteLine($"{image.Width}x{image.Height}");
Console.WriteLine($"image loaded: {image.Width}x{image.Height}");
//foreach (IExifValue exif in image.Metadata.ExifProfile.Values) {
// Console.WriteLine($"{exif.Tag} : {exif.GetValue()}");
//}
@ -205,6 +205,17 @@ public class Game : GameWindow {
if (input.IsKeyDown(Keys.Escape)) {
Close();
}
if (input.IsKeyPressed(Keys.Down)) {
if (textureIndex < textures.Count - 1) {
textureIndex++;
}
}
if (input.IsKeyPressed(Keys.Up)) {
if (textureIndex > 0) {
textureIndex--;
}
}
}
protected override void OnLoad() {
@ -292,7 +303,6 @@ static class Program {
}
}
Console.WriteLine($"best monitor: {bestMonitor.HorizontalResolution}x{bestMonitor.VerticalResolution}");
Console.WriteLine($"{bestMonitor.ClientArea}, {bestMonitor.WorkArea}");
GameWindowSettings gwSettings = new GameWindowSettings();
gwSettings.RenderFrequency = 60.0;

Loading…
Cancel
Save