| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- //
- // System.Drawing.Drawing2D.HatchBrush.cs
- //
- // Authors:
- // Dennis Hayes ([email protected])
- // Ravindra ([email protected])
- //
- // (C) 2002/3 Ximian, Inc
- // (C) 2004 Novell, Inc.
- //
- using System;
- namespace System.Drawing.Drawing2D
- {
- /// <summary>
- /// Summary description for HatchBrush.
- /// </summary>
- public sealed class HatchBrush : Brush
- {
- internal HatchBrush (IntPtr ptr) : base (ptr)
- {
- }
- public HatchBrush (HatchStyle hatchStyle, Color foreColor)
- : this (hatchStyle, foreColor, Color.Black)
- {
- }
- public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
- {
- Status status = GDIPlus.GdipCreateHatchBrush (hatchStyle, foreColor.ToArgb (), backColor.ToArgb (), out nativeObject);
- GDIPlus.CheckStatus (status);
- }
- public Color BackgroundColor {
- get {
- int argb;
- Status status = GDIPlus.GdipGetHatchBackgroundColor (nativeObject, out argb);
- GDIPlus.CheckStatus (status);
- return Color.FromArgb (argb);
- }
- }
- public Color ForegroundColor {
- get {
- int argb;
- Status status = GDIPlus.GdipGetHatchForegroundColor (nativeObject, out argb);
- GDIPlus.CheckStatus (status);
- return Color.FromArgb (argb);
- }
- }
- public HatchStyle HatchStyle {
- get {
- HatchStyle hatchStyle;
- Status status = GDIPlus.GdipGetHatchStyle (nativeObject, out hatchStyle);
- GDIPlus.CheckStatus (status);
- return hatchStyle;
- }
- }
- public override object Clone ()
- {
- IntPtr clonePtr;
- Status status = GDIPlus.GdipCloneBrush (nativeObject, out clonePtr);
- GDIPlus.CheckStatus (status);
- HatchBrush clone = new HatchBrush (clonePtr);
- return clone;
- }
- }
- }
|