зеркало из https://github.com/mono/SkiaSharp.git
Improvements to XPS support #266
This commit is contained in:
Родитель
4afcf77ad9
Коммит
1bd916a59a
|
@ -1 +1 @@
|
|||
Subproject commit f95f135c485305abede487df9a7fd2d0efc0ed20
|
||||
Subproject commit 799209411ee741b4a2c90bca87de8448e3965285
|
|
@ -11,6 +11,7 @@ namespace SkiaSharpSample.Samples
|
|||
public class CreateXpsSample : SampleBase
|
||||
{
|
||||
private string root;
|
||||
private bool xpsSupported = true;
|
||||
|
||||
[Preserve]
|
||||
public CreateXpsSample()
|
||||
|
@ -46,7 +47,7 @@ namespace SkiaSharpSample.Samples
|
|||
paint.StrokeWidth = 3;
|
||||
paint.TextAlign = SKTextAlign.Center;
|
||||
|
||||
canvas.DrawText("tap to open XPS", width / 2f, height / 3, paint);
|
||||
canvas.DrawText(xpsSupported ? "tap to open XPS" : "Oops! No XPS support!", width / 2f, height / 3, paint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,6 +61,13 @@ namespace SkiaSharpSample.Samples
|
|||
using (var document = SKDocument.CreateXps(stream))
|
||||
using (var paint = new SKPaint())
|
||||
{
|
||||
if (document == null)
|
||||
{
|
||||
xpsSupported = false;
|
||||
Refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
paint.TextSize = 64.0f;
|
||||
paint.IsAntialias = true;
|
||||
paint.Color = (SKColor)0xFF9CAFB7;
|
||||
|
|
Загрузка…
Ссылка в новой задаче