4 changed files with 82 additions and 53 deletions
@ -0,0 +1,24 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="CairoPlatform.cs" company="Steven Kirk">
|
|||
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Cairo |
|||
{ |
|||
using Cairo = global::Cairo; |
|||
|
|||
public static class CairoExtensions |
|||
{ |
|||
public static Cairo.Matrix ToCairo(this Matrix m) |
|||
{ |
|||
return new Cairo.Matrix(m.M11, m.M12, m.M21, m.M22, m.OffsetX, m.OffsetY); |
|||
} |
|||
|
|||
public static Cairo.Rectangle ToCairo(this Rect rect) |
|||
{ |
|||
return new Cairo.Rectangle(rect.X, rect.Y, rect.Width, rect.Height); |
|||
} |
|||
} |
|||
} |
|||
|
|||
@ -1,37 +1,42 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="BitmapImpl.cs" company="Steven Kirk">
|
|||
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Cairo.Media.Imaging |
|||
{ |
|||
using System; |
|||
using global::Cairo; |
|||
using Perspex.Platform; |
|||
|
|||
public class BitmapImpl : IBitmapImpl |
|||
{ |
|||
private ImageSurface surface; |
|||
|
|||
public BitmapImpl(ImageSurface surface) |
|||
{ |
|||
this.surface = surface; |
|||
} |
|||
|
|||
public int PixelWidth |
|||
{ |
|||
get { return this.surface.Width; } |
|||
} |
|||
|
|||
public int PixelHeight |
|||
{ |
|||
get { return this.surface.Height; } |
|||
} |
|||
|
|||
public void Save(string fileName) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="BitmapImpl.cs" company="Steven Kirk">
|
|||
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Cairo.Media.Imaging |
|||
{ |
|||
using System; |
|||
using Perspex.Platform; |
|||
using Cairo = global::Cairo; |
|||
|
|||
public class BitmapImpl : IBitmapImpl |
|||
{ |
|||
|
|||
public BitmapImpl(Cairo.ImageSurface surface) |
|||
{ |
|||
this.Surface = surface; |
|||
} |
|||
|
|||
public int PixelWidth |
|||
{ |
|||
get { return this.Surface.Width; } |
|||
} |
|||
|
|||
public int PixelHeight |
|||
{ |
|||
get { return this.Surface.Height; } |
|||
} |
|||
|
|||
public Cairo.ImageSurface Surface |
|||
{ |
|||
get; |
|||
private set; |
|||
} |
|||
|
|||
public void Save(string fileName) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
|
|||
Loading…
Reference in new issue