Skip to content

Commit

Permalink
Make include file contents inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbritch committed Jan 10, 2024
1 parent 8c9920c commit aac0ca8
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 42 deletions.
37 changes: 36 additions & 1 deletion 8.0/SkiaSharp/MandelbrotAnimation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,39 @@ When you first run the program, the `Label` at the top of the program shows whic
> [!NOTE]
> On some devices, the animation runs smoother if the sample is not being run under control of Visual Studio's debugger.
[!INCLUDE [Install SkiaSharp](../includes/install-skiasharp.md)]
## Use SkiaSharp in an app

To use SkiaSharp in your .NET MAUI app you should:

1. Add the `SkiaSharp.Views.Maui.Controls` NuGet package to your app. This will also install dependent SkiaSharp packages.
1. Initialize SkiaSharp in your app by calling the `UseSkiaSharp` method on the `MauiAppBuilder` object in your `MauiProgram` class:


```csharp
using Microsoft.Extensions.Logging;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace MyMauiApp;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSkiaSharp()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
```
37 changes: 36 additions & 1 deletion 8.0/SkiaSharp/PhotoPuzzle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,39 @@ This sample demonstrates the use of SkiaSharp in a .NET Multi-platform App UI (.

After pressing the **Randomize** button, just tap a tile to move it into an empty position. You can *tap* any tile in the row or column of the empty position to move one, two, or three tiles at once. Use the numbers in the lower-right corner of each tile as a guide.

[!INCLUDE [Install SkiaSharp](../includes/install-skiasharp.md)]
## Use SkiaSharp in an app

To use SkiaSharp in your .NET MAUI app you should:

1. Add the `SkiaSharp.Views.Maui.Controls` NuGet package to your app. This will also install dependent SkiaSharp packages.
1. Initialize SkiaSharp in your app by calling the `UseSkiaSharp` method on the `MauiAppBuilder` object in your `MauiProgram` class:


```csharp
using Microsoft.Extensions.Logging;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace MyMauiApp;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSkiaSharp()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
```
37 changes: 36 additions & 1 deletion 8.0/SkiaSharp/SkiaSharpDemos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,39 @@ SkiaSharp is a 2D graphics system for .NET and C# powered by the open-source Ski

This sample demonstrates the use of SkiaSharp in a .NET MAUI app.

[!INCLUDE [Install SkiaSharp](../includes/install-skiasharp.md)]
## Use SkiaSharp in an app

To use SkiaSharp in your .NET MAUI app you should:

1. Add the `SkiaSharp.Views.Maui.Controls` NuGet package to your app. This will also install dependent SkiaSharp packages.
1. Initialize SkiaSharp in your app by calling the `UseSkiaSharp` method on the `MauiAppBuilder` object in your `MauiProgram` class:


```csharp
using Microsoft.Extensions.Logging;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace MyMauiApp;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSkiaSharp()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
```
37 changes: 36 additions & 1 deletion 8.0/SkiaSharp/SpinPaint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,39 @@ SpinPaint demonstrates the use of SkiaSharp in a .NET Multi-platform App UI (.NE

![SpinPaint app screenshot](Screenshots/SpinPaint.png "SpinPaint app screenshot")

[!INCLUDE [Install SkiaSharp](../includes/install-skiasharp.md)]
## Use SkiaSharp in an app

To use SkiaSharp in your .NET MAUI app you should:

1. Add the `SkiaSharp.Views.Maui.Controls` NuGet package to your app. This will also install dependent SkiaSharp packages.
1. Initialize SkiaSharp in your app by calling the `UseSkiaSharp` method on the `MauiAppBuilder` object in your `MauiProgram` class:


```csharp
using Microsoft.Extensions.Logging;
using SkiaSharp.Views.Maui.Controls.Hosting;

namespace MyMauiApp;

public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseSkiaSharp()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
```
38 changes: 0 additions & 38 deletions 8.0/SkiaSharp/includes/install-skiasharp.md

This file was deleted.

0 comments on commit aac0ca8

Please sign in to comment.