-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWebPImage.cs
More file actions
70 lines (42 loc) · 1.45 KB
/
Copy pathWebPImage.cs
File metadata and controls
70 lines (42 loc) · 1.45 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#if NETFRAMEWORK
using Gsemac.IO;
using System;
using System.Drawing;
using WebPWrapper;
namespace Gsemac.Drawing.Imaging {
internal class WebPImage :
ImageBase {
// Public members
public override int Width => image.Width;
public override int Height => image.Height;
public override IFileFormat Format => image.Format;
public override IImageCodec Codec => image.Codec;
public override TimeSpan AnimationDelay { get; } = TimeSpan.Zero;
public override int AnimationIterations { get; } = 0;
public override int FrameCount { get; } = 1;
public override IImage Clone() {
return image.Clone();
}
public override Bitmap ToBitmap() {
return image.ToBitmap();
}
public WebPImage(IImage image, int frameCount, int animationIterations, TimeSpan animationDelay) {
if (image is null)
throw new ArgumentNullException(nameof(image));
this.image = image;
FrameCount = frameCount;
AnimationIterations = animationIterations;
AnimationDelay = animationDelay;
}
// Protected members
protected override void Dispose(bool disposing) {
if (disposing) {
image.Dispose();
}
base.Dispose(disposing);
}
// Private members
private readonly IImage image;
}
}
#endif