diff options
author | 杨宇千 <crupest@outlook.com> | 2019-09-01 23:21:59 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-09-01 23:21:59 +0800 |
commit | 3e4405f016ec6cf56bc86577a4662f2fb8f03cc4 (patch) | |
tree | a20e7f1b6d8d11c8173a2a558f25749529acd08e /Timeline.Tests/Helpers | |
parent | ee73f13b903e953f9bbb730514bf1faa1204e1d0 (diff) | |
download | timeline-3e4405f016ec6cf56bc86577a4662f2fb8f03cc4.tar.gz timeline-3e4405f016ec6cf56bc86577a4662f2fb8f03cc4.tar.bz2 timeline-3e4405f016ec6cf56bc86577a4662f2fb8f03cc4.zip |
Add more tests on avatar.
Diffstat (limited to 'Timeline.Tests/Helpers')
-rw-r--r-- | Timeline.Tests/Helpers/ImageHelper.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/ImageHelper.cs b/Timeline.Tests/Helpers/ImageHelper.cs index c5a9cf17..2a2f3870 100644 --- a/Timeline.Tests/Helpers/ImageHelper.cs +++ b/Timeline.Tests/Helpers/ImageHelper.cs @@ -1,4 +1,5 @@ using SixLabors.ImageSharp;
+using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats;
using System.IO;
@@ -17,5 +18,17 @@ namespace Timeline.Tests.Helpers }
}
}
+
+ public static byte[] CreateImageWithSize(int width, int height, IImageFormat format)
+ {
+ using (var image = new Image<Rgba32>(width, height))
+ {
+ using (var stream = new MemoryStream())
+ {
+ image.Save(stream, format);
+ return stream.ToArray();
+ }
+ }
+ }
}
}
|