Added support for creating a SKCanvas from a SKBitmap
This commit is contained in:
Родитель
82d216e10d
Коммит
0f12502d98
|
@ -19,6 +19,14 @@ namespace SkiaSharp
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SKCanvas (SKBitmap bitmap)
|
||||||
|
: this (IntPtr.Zero, true)
|
||||||
|
{
|
||||||
|
if (bitmap == null)
|
||||||
|
throw new ArgumentNullException (nameof (bitmap));
|
||||||
|
Handle = SkiaApi.sk_canvas_new_from_bitmap (bitmap.Handle);
|
||||||
|
}
|
||||||
|
|
||||||
public int Save ()
|
public int Save ()
|
||||||
{
|
{
|
||||||
if (Handle == IntPtr.Zero)
|
if (Handle == IntPtr.Zero)
|
||||||
|
|
|
@ -175,6 +175,8 @@ namespace SkiaSharp
|
||||||
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
|
||||||
[return: MarshalAs(UnmanagedType.I1)]
|
[return: MarshalAs(UnmanagedType.I1)]
|
||||||
public extern static bool sk_canvas_get_clip_bounds(sk_canvas_t t, ref SKRect cbounds);
|
public extern static bool sk_canvas_get_clip_bounds(sk_canvas_t t, ref SKRect cbounds);
|
||||||
|
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public extern static sk_canvas_t sk_canvas_new_from_bitmap(sk_bitmap_t bitmap);
|
||||||
|
|
||||||
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(SKIA, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public extern static sk_paint_t sk_paint_new();
|
public extern static sk_paint_t sk_paint_new();
|
||||||
|
|
2
skia
2
skia
|
@ -1 +1 @@
|
||||||
Subproject commit 4c78a3f640ba324ac0fc8609f3e7870dd7dae202
|
Subproject commit e059dab91769c3de9e15133ec1d855a93d40c693
|
Загрузка…
Ссылка в новой задаче