CrossGraphics aims to deliver a simple immediate mode interface for drawing graphics on a variety of platforms running .NET.
Currently the following platforms are supported:
- MonoTouch using
UIKitGraphics.cs
- MonoDroid using
DroidGraphics.cs
- Silverlight and Windows Phone 7 using
SilverlightGraphics.cs
Add a reference to the cross-platform file Graphics.cs
. This will expose the
interface CrossGraphics.IGraphics
that is the recipient of all drawing commands.
Drawing commands include:
- Rectangles using
FillRect
andDrawRect
- Rounded Rectangles using
FillRoundedRect
andDrawRoundedRect
- Ovals using
FillOval
andDrawOval
- Lines using
DrawLine
and the optionBeginLine
andEndLine
primitives - Images using
DrawImage
- Text using
DrawString
and the associated font functions
Add a reference to the appropriate platform-specific implementation of IGraphics
.
Create the appropriate graphics context and pass it to your objects that expect
an IGraphics
object.
The code is copyright Frank A. Krueger and is released under the MIT license.