initial push
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Media.Imaging;
|
||||
using Avalonia.Platform.Storage;
|
||||
|
||||
namespace Photos.Models;
|
||||
|
||||
public class Photo
|
||||
{
|
||||
public string DisplayName { get; set; }
|
||||
public string FullPath { get; set; }
|
||||
public string DisplayPath { get; set; }
|
||||
|
||||
public IImage Source { get; set; }
|
||||
|
||||
public Photo(string path, string relativeTo)
|
||||
{
|
||||
DisplayName = System.IO.Path.GetFileName(path);
|
||||
FullPath = path;
|
||||
DisplayPath = path.Remove(0, relativeTo.Length + 1);
|
||||
using (var stream = File.OpenRead(path))
|
||||
{
|
||||
Source = new Bitmap(stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user