From f822a0760233eeaad0682b6552c2ad7a32409599 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Thu, 29 Jun 2023 22:21:41 -0400 Subject: [PATCH] add Width and Height to Texture --- Program.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 8d29d4a..eb72f98 100644 --- a/Program.cs +++ b/Program.cs @@ -125,14 +125,19 @@ void main() { public class Texture : IDisposable { public int Handle; + public int Width; + public int Height; public Texture(string path) { Image image = Image.Load(path); - Console.WriteLine($"image loaded: {image.Width}x{image.Height}"); + Width = image.Width; + Height = image.Height; + Console.WriteLine($"image loaded: {Width}x{Height}"); + //foreach (IExifValue exif in image.Metadata.ExifProfile.Values) { // Console.WriteLine($"{exif.Tag} : {exif.GetValue()}"); //} - byte[] pixelBytes = new byte[image.Width * image.Height * Unsafe.SizeOf()]; + byte[] pixelBytes = new byte[Width * Height * Unsafe.SizeOf()]; image.CopyPixelDataTo(pixelBytes); image.Dispose();