Skip to content
This repository was archived by the owner on Jan 18, 2020. It is now read-only.

Commit f8432e2

Browse files
Merge pull request #28 from SixLabors/core-2
Add netstandard2.0 target framework +update dependencies
2 parents 082135e + 98261c3 commit f8432e2

File tree

7 files changed

+27
-28
lines changed

7 files changed

+27
-28
lines changed

samples/DrawShapesWithImageSharp/DrawShapesWithImageSharp.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="ImageSharp.Drawing" Version="1.0.0-alpha9-00189" />
19-
<PackageReference Include="ImageSharp" Version="1.0.0-alpha9-00194" />
18+
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="1.0.0-beta0001" />
2019
<PackageReference Include="System.Runtime.Numerics" Version="4.3.0" />
2120
</ItemGroup>
2221

samples/DrawShapesWithImageSharp/ImageSharpLogo.cs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
using ImageSharp;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
4-
using System.Linq;
53
using System.Numerics;
6-
using System.Threading.Tasks;
4+
using SixLabors.ImageSharp;
75

86
namespace SixLabors.Shapes.DrawShapesWithImageSharp
97
{
@@ -14,7 +12,7 @@ public static void SaveLogo(float size, string path)
1412
// the point are based on a 1206x1206 shape so size requires scaling from there
1513

1614
float scalingFactor = size / 1206;
17-
15+
1816
var center = new Vector2(603);
1917

2018
// segment whoes cetner of rotation should be
@@ -49,16 +47,16 @@ public static void SaveLogo(float size, string path)
4947
var dimensions = (int)Math.Ceiling(size);
5048
using (var img = new Image<Rgba32>(dimensions, dimensions))
5149
{
52-
img.Fill(Rgba32.Black);
53-
img.Fill(Rgba32.FromHex("e1e1e1ff"), new SixLabors.Shapes.EllipsePolygon(center, 600f).Transform(scaler));
54-
img.Fill(Rgba32.White, new SixLabors.Shapes.EllipsePolygon(center, 600f - 60).Transform(scaler));
50+
img.Mutate(i => i.Fill(Rgba32.Black));
51+
img.Mutate(i => i.Fill(Rgba32.FromHex("e1e1e1ff"), new EllipsePolygon(center, 600f).Transform(scaler)));
52+
img.Mutate(i => i.Fill(Rgba32.White, new EllipsePolygon(center, 600f - 60).Transform(scaler)));
5553

56-
for (var i = 0; i < 6; i++)
54+
for (var s = 0; s < 6; s++)
5755
{
58-
img.Fill(colors[i], segments[i].Transform(scaler));
56+
img.Mutate(i => i.Fill(colors[s], segments[s].Transform(scaler)));
5957
}
6058

61-
img.Fill(new Rgba32(0, 0, 0, 170), new ComplexPolygon(new SixLabors.Shapes.EllipsePolygon(center, 161f), new SixLabors.Shapes.EllipsePolygon(center, 61f)).Transform(scaler));
59+
img.Mutate(i => i.Fill(new Rgba32(0, 0, 0, 170), new ComplexPolygon(new EllipsePolygon(center, 161f), new EllipsePolygon(center, 61f)).Transform(scaler)));
6260

6361
var fullPath = System.IO.Path.GetFullPath(System.IO.Path.Combine("Output", path));
6462

samples/DrawShapesWithImageSharp/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ImageSharp;
1+
using SixLabors.ImageSharp;
22
using System;
33
using System.IO;
44

@@ -206,12 +206,12 @@ public static void SaveImage(this IPathCollection shape, params string[] path)
206206

207207
using (var img = new Image<Rgba32>(width, height))
208208
{
209-
img.Fill(Rgba32.DarkBlue);
209+
img.Mutate(i => i.Fill(Rgba32.DarkBlue));
210210

211211
foreach (var s in shape)
212212
{
213213
// In ImageSharp.Drawing.Paths there is an extension method that takes in an IShape directly.
214-
img.Fill(Rgba32.HotPink, s, new ImageSharp.GraphicsOptions(true));
214+
img.Mutate(i => i.Fill(Rgba32.HotPink, s, new GraphicsOptions(true)));
215215
}
216216
// img.Draw(Color.LawnGreen, 1, new ShapePath(shape));
217217

@@ -232,13 +232,13 @@ public static void SaveImage(this IPathCollection shape, int width, int height,
232232

233233
using (var img = new Image<Rgba32>(width, height))
234234
{
235-
img.Fill(Rgba32.DarkBlue);
235+
img.Mutate(i => i.Fill(Rgba32.DarkBlue));
236236

237237
// In ImageSharp.Drawing.Paths there is an extension method that takes in an IShape directly.
238238
foreach (var s in shape)
239239
{
240240
// In ImageSharp.Drawing.Paths there is an extension method that takes in an IShape directly.
241-
img.Fill(Rgba32.HotPink, s, new ImageSharp.GraphicsOptions(true));
241+
img.Mutate(i => i.Fill(Rgba32.HotPink, s, new GraphicsOptions(true)));
242242
}
243243

244244
// img.Draw(Color.LawnGreen, 1, new ShapePath(shape));

src/SixLabors.Shapes.Text/PathGlyphBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ internal class PathGlyphBuilder : GlyphBuilder
1818

1919
private float yOffset = 0;
2020

21+
// TODO: Change to MathF on next release. AssemblyInfo.cs in Core did not list this project
2122
const float Pi = (float)Math.PI;
2223
const float HalfPi = Pi / 2f;
2324

src/SixLabors.Shapes.Text/SixLabors.Shapes.Text.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<AssemblyTitle>SixLabors.Shapes.Text</AssemblyTitle>
66
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
77
<VersionPrefix Condition="$(packageversion) == ''">0.1.0-alpha1</VersionPrefix>
8-
<Authors>Scott Williams and contributors</Authors>
9-
<TargetFramework>netstandard1.1</TargetFramework>
8+
<Authors>Six Labors and contributors</Authors>
9+
<TargetFrameworks>netstandard1.1;netstandard2.0</TargetFrameworks>
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1111
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1212
<AssemblyName>SixLabors.Shapes.Text</AssemblyName>
@@ -34,7 +34,8 @@
3434
</ItemGroup>
3535

3636
<ItemGroup>
37-
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta0002" />
37+
<!--TODO: Add StyleCop; No time just now-->
38+
<PackageReference Include="SixLabors.Fonts" Version="1.0.0-beta0003" />
3839
</ItemGroup>
3940

4041
<ItemGroup>

src/SixLabors.Shapes.Text/TextBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace SixLabors.Shapes
1414
public static class TextBuilder
1515
{
1616
/// <summary>
17-
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
17+
/// Generates the shapes corresponding the glyphs described by the font and with the settings withing the FontSpan
1818
/// </summary>
1919
/// <param name="text">The text to generate glyphs for</param>
2020
/// <param name="location">The location</param>
@@ -32,7 +32,7 @@ public static IPathCollection GenerateGlyphs(string text, PointF location, Rende
3232
}
3333

3434
/// <summary>
35-
/// Generates the shapes corresponding the glyphs described by the font and with the setting ing withing the FontSpan
35+
/// Generates the shapes corresponding the glyphs described by the font and with the settings withing the FontSpan
3636
/// </summary>
3737
/// <param name="text">The text to generate glyphs for</param>
3838
/// <param name="style">The style and settings to use while rendering the glyphs</param>

src/SixLabors.Shapes/SixLabors.Shapes.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
<PropertyGroup>
44
<Description>Polygon manipulation/merging and interrogation library.
55

6-
Its a fully manged netstandard library so should work everywhere.</Description>
6+
It's a fully managed netstandard library so should work everywhere.</Description>
77
<AssemblyTitle>SixLabors.Shapes</AssemblyTitle>
88
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
99
<VersionPrefix Condition="$(packageversion) == ''">0.1.0-alpha1</VersionPrefix>
10-
<Authors>Scott Williams and contributors</Authors>
11-
<TargetFramework>netstandard1.1</TargetFramework>
10+
<Authors>Six Labors and contributors</Authors>
11+
<TargetFrameworks>netstandard1.1;netstandard2.0</TargetFrameworks>
1212
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1313
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1414
<AssemblyName>SixLabors.Shapes</AssemblyName>
@@ -35,8 +35,8 @@ Its a fully manged netstandard library so should work everywhere.</Description>
3535
<Compile Include="..\Shared\*.cs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
3636
</ItemGroup>
3737
<ItemGroup>
38-
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0003" />
38+
<!--TODO: Add StyleCop; No time just now-->
39+
<PackageReference Include="SixLabors.Core" Version="1.0.0-beta0004" />
3940
<PackageReference Include="System.Buffers" Version="4.4.0" />
4041
</ItemGroup>
41-
4242
</Project>

0 commit comments

Comments
 (0)