-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImagePreviewFrame.cs
More file actions
35 lines (30 loc) · 893 Bytes
/
ImagePreviewFrame.cs
File metadata and controls
35 lines (30 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace CFRezManager;
public sealed record ImagePreviewDocument(
string ImageName,
IReadOnlyList<ImagePreviewFrame> Frames,
string? ImageInfo = null,
double? AnimationFrameRate = null);
public sealed record ImagePreviewFrame(string Name, ImageSource Source)
{
private const string FramePrefix = "Frame ";
public string LocalizedName
{
get
{
return Name.StartsWith(FramePrefix, StringComparison.Ordinal)
? $"{LocalizedText.T("PreviewFrame")} {Name[FramePrefix.Length..]}"
: Name;
}
}
public string DisplayName
{
get
{
return Source is BitmapSource bitmap
? $"{LocalizedName} {bitmap.PixelWidth} x {bitmap.PixelHeight}"
: LocalizedName;
}
}
}