GDIPlus.CheckStatus (status);
}
- [MonoTODO]
- public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
+ [MonoTODO ("GdipAddStringI isn't implemented in libgdiplus")]
+ public void AddString (string s, FontFamily family, int style, float emSize, Point origin, StringFormat format)
+ {
+ Rectangle layout;
+ layout.X = origin.X;
+ layout.Y = origin.Y;
+ AddString (s, family, style, emSize, layout, format);
+ }
+
+ [MonoTODO ("GdipAddString isn't implemented in libgdiplus")]
+ public void AddString (string s, FontFamily family, int style, float emSize, PointF origin, StringFormat format)
{
- throw new NotImplementedException ();
- }
-
+ RectangleF layout;
+ layout.X = origin.X;
+ layout.Y = origin.Y;
+ AddString (s, family, style, emSize, layout, format);
+ }
+
+ [MonoTODO ("GdipAddStringI isn't implemented in libgdiplus")]
+ public void AddString (string s, FontFamily family, int style, float emSize, Rectangle layoutRect, StringFormat format)
+ {
+ if (s == null)
+ throw new ArgumentNullException ("s");
+
+ IntPtr ffamily = (family == null) ? IntPtr.Zero : family.NativeObject;
+ IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject;
+
+ Status status = GDIPlus.GdipAddStringI (nativePath, s, s.Length, ffamily, style, emSize, ref layoutRect, sformat);
+ GDIPlus.CheckStatus (status);
+ }
+
+ [MonoTODO ("GdipAddString isn't implemented in libgdiplus")]
+ public void AddString (string s, FontFamily family, int style, float emSize, RectangleF layoutRect, StringFormat format)
+ {
+ if (s == null)
+ throw new ArgumentNullException ("s");
+
+ IntPtr ffamily = (family == null) ? IntPtr.Zero : family.NativeObject;
+ IntPtr sformat = (format == null) ? IntPtr.Zero : format.NativeObject;
+
+ Status status = GDIPlus.GdipAddString (nativePath, s, s.Length, ffamily, style, emSize, ref layoutRect, sformat);
+ GDIPlus.CheckStatus (status);
+ }
+
public void ClearMarkers()
{
Status s = GDIPlus.GdipClearPathMarkers (nativePath);
// Ravindra (rkumar@novell.com)
//
// Copyright (C) 2002/3 Ximian, Inc. http://www.ximian.com
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-using System.Drawing;
+using System.ComponentModel;
+
+namespace System.Drawing.Drawing2D {
-namespace System.Drawing.Drawing2D
-{
- /// <summary>
- /// Summary description for LinearGradientBrush.
- /// </summary>
public sealed class LinearGradientBrush : Brush
{
RectangleF rectangle;
internal LinearGradientBrush (IntPtr native) : base (native)
{
+ Status status = GDIPlus.GdipGetLineRect (native, out rectangle);
+ GDIPlus.CheckStatus (status);
}
public LinearGradientBrush (Point point1, Point point2, Color color1, Color color2)
return matrix;
}
set {
+ if (value == null)
+ throw new ArgumentNullException ("Transform");
+
Status status = GDIPlus.GdipSetLineTransform (nativeObject, value.nativeMatrix);
GDIPlus.CheckStatus (status);
}
return wrapMode;
}
set {
+ // note: Clamp isn't valid (context wise) but it is checked in libgdiplus
+ if ((value < WrapMode.Tile) || (value > WrapMode.Clamp))
+ throw new InvalidEnumArgumentException ("WrapMode");
+
Status status = GDIPlus.GdipSetLineWrapMode (nativeObject, value);
GDIPlus.CheckStatus (status);
}
public void MultiplyTransform (Matrix matrix, MatrixOrder order)
{
+ if (matrix == null)
+ throw new ArgumentNullException ("matrix");
+
Status status = GDIPlus.GdipMultiplyLineTransform (nativeObject, matrix.nativeMatrix, order);
GDIPlus.CheckStatus (status);
}
Status status = GDIPlus.GdipCloneBrush (nativeObject, out clonePtr);
GDIPlus.CheckStatus (status);
- LinearGradientBrush clone = new LinearGradientBrush (clonePtr);
- return clone;
+ return new LinearGradientBrush (clonePtr);
}
}
}