This commit is contained in:
Matthew Leibowitz 2017-12-18 00:14:14 +02:00
Родитель 64f96d3b3e
Коммит 805e64d506
3 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -6,6 +6,8 @@ using System.Windows.Forms;
namespace SkiaSharp.Views.Desktop
{
[DefaultEvent("PaintSurface")]
[DefaultProperty("Name")]
public class SKControl : Control
{
private readonly bool designMode;
@ -20,8 +22,13 @@ namespace SkiaSharp.Views.Desktop
designMode = DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime;
}
[Bindable(false)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
public SKSize CanvasSize => bitmap == null ? SKSize.Empty : new SKSize(bitmap.Width, bitmap.Height);
[Category("Appearance")]
public event EventHandler<SKPaintSurfaceEventArgs> PaintSurface;
protected override void OnPaint(PaintEventArgs e)

Просмотреть файл

@ -5,6 +5,8 @@ using OpenTK;
namespace SkiaSharp.Views.Desktop
{
[DefaultEvent("PaintSurface")]
[DefaultProperty("Name")]
public class SKGLControl : GLControl
{
private readonly bool designMode;
@ -19,10 +21,19 @@ namespace SkiaSharp.Views.Desktop
ResizeRedraw = true;
}
[Bindable(false)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
public SKSize CanvasSize => new SKSize(renderTarget.Width, renderTarget.Height);
[Bindable(false)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
public GRContext GRContext => grContext;
[Category("Appearance")]
public event EventHandler<SKPaintGLSurfaceEventArgs> PaintSurface;
protected override void OnPaint(PaintEventArgs e)

Просмотреть файл

@ -11,6 +11,8 @@ using SkiaSharp.Views.Desktop;
namespace SkiaSharp.Views.WPF
{
[DefaultEvent("PaintSurface")]
[DefaultProperty("Name")]
public class SKElement : FrameworkElement
{
private readonly bool designMode;
@ -23,6 +25,10 @@ namespace SkiaSharp.Views.WPF
designMode = DesignerProperties.GetIsInDesignMode(this);
}
[Bindable(false)]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[EditorBrowsable(EditorBrowsableState.Never)]
public SKSize CanvasSize => bitmap == null ? SKSize.Empty : new SKSize(bitmap.PixelWidth, bitmap.PixelHeight);
public bool IgnorePixelScaling
@ -35,6 +41,7 @@ namespace SkiaSharp.Views.WPF
}
}
[Category("Appearance")]
public event EventHandler<SKPaintSurfaceEventArgs> PaintSurface;
protected override void OnRender(DrawingContext drawingContext)