本文整理汇总了C#中HatchStyle类的典型用法代码示例。如果您正苦于以下问题:C# HatchStyle类的具体用法?C# HatchStyle怎么用?C# HatchStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HatchStyle类属于命名空间,在下文中一共展示了HatchStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HatchBrush
public HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor)
{
this.hatchStyle = hatchStyle;
this.foreCol = foreColor;
this.backCol = backColor;
base.native = LibIGraph.CreateBrush_Hatch(hatchStyle, foreCol.ToArgb(), backCol.ToArgb());
}
示例2: FillImageByHatch
protected void FillImageByHatch(Image img, HatchStyle s)
{
Graphics g = Graphics.FromImage(img);
HatchBrush brush = new HatchBrush(s, Color.Black, Color.White);
g.FillRectangle(brush, new Rectangle(0, 0, img.Width, img.Height));
g.Dispose();
}
示例3: Captcha
public Captcha(int Width, int Height, HatchStyle TextStyle = HatchStyle.NarrowHorizontal, HatchStyle BackStyle = HatchStyle.DottedGrid)
{
this.Width = Width;
this.Height = Height;
this.TextStyle = TextStyle;
this.BackStyle = BackStyle;
}
示例4: GBrush
public GBrush(BrushStyle aStyle, HatchStyle hatchStyle, Colorref aColor, Guid uniqueID)
{
BrushStyle = aStyle;
HatchStyle = hatchStyle;
Color = aColor;
UniqueID = uniqueID;
}
示例5: GradientStyle
public GradientStyle(HatchStyle hatch, Color fore, Color back)
{
Type = GradientType.HatchStyleGradient;
FirstColor = fore;
SecondColor = back;
Hatch = hatch;
}
示例6: HatchBrush
public HatchBrush(HatchStyle style, Color foreground, Color background)
{
_hatchStyle = style;
_foregroundColor = foreground;
_backgroundColor = background;
throw new NotImplementedException();
}
示例7: DrawingHatchBrush
// Constructor.
public DrawingHatchBrush(HatchStyle style,
System.Drawing.Color foreColor,
System.Drawing.Color backColor) : base (foreColor)
{
this.style = style;
this.foreColor = foreColor;
this.backColor = backColor;
}
示例8: HatchBrush
public HatchBrush(HatchStyle hatchstyle, Color foreColor, Color backColor)
{
IntPtr brush = IntPtr.Zero;
int status = SafeNativeMethods.Gdip.GdipCreateHatchBrush(unchecked((int) hatchstyle), foreColor.ToArgb(), backColor.ToArgb(), out brush);
if (status != SafeNativeMethods.Gdip.Ok)
throw SafeNativeMethods.Gdip.StatusException(status);
SetNativeBrushInternal(brush);
}
示例9: HatchPattern
/// <summary>
/// Initializes a new instance of the <c>HatchPattern</c> class.
/// </summary>
/// <param name="name">Pattern name, always stored as uppercase.</param>
/// <param name="description">Description of the pattern (optional, this information is not saved in the dxf file). By default it will use the supplied name.</param>
public HatchPattern(string name, string description = null)
{
this.name = name.ToUpper();
this.description = string.IsNullOrEmpty(description) ? name : description;
this.style = HatchStyle.Normal;
this.fill = this.name == "SOLID" ? HatchFillType.SolidFill : HatchFillType.PatternFill;
this.type = HatchType.UserDefined;
this.origin = Vector2.Zero;
this.angle = 0.0;
this.scale = 1.0;
this.lineDefinitions = new List<HatchPatternLineDefinition>();
}
示例10: SetDataSource
void SetDataSource(HatchStyle selected)
{
this.BeginUpdate();
Items.Clear();
foreach (HatchStyle o in Enum.GetValues(typeof(HatchStyle)))
Items.Add(o);
SelectedItem = selected;
this.EndUpdate();
}
示例11: EditorHatchStyleUI
/// <summary>
/// Constructor that takes a HatchStyle, BackColor and ForeColor as arguments.
/// </summary>
/// <param name="hs">HatchStyle to be used in the instance created.</param>
/// <param name="cBack">BackColor to be used in the instance created.</param>
/// <param name="cFore">ForeColor to be used in the instance created.</param>
public EditorHatchStyleUI(HatchStyle hs, Color cBack, Color cFore)
{
InitializeComponent();
AddHatchStylesToListBox();
hsHatchStyle = hs;
cHatchStyleBackColor = cBack;
cHatchStyleForeColor = cFore;
this.Width = 224;
}
示例12: GDIBrush
public GDIBrush(BrushStyle aStyle, HatchStyle hatchStyle, Colorref colorref, Guid uniqueID)
: base(true, uniqueID)
{
fBrushStyle = aStyle;
fHatchStyle = hatchStyle;
fColor = colorref;
fLogBrush = new LOGBRUSH32();
// Make sure to mask off the high order byte
// or GDI will draw in black
fLogBrush.lbColor = colorref & 0x00ffffff;
fLogBrush.lbHatch = (int)hatchStyle;
fLogBrush.lbStyle = (int)aStyle;
IntPtr brushHandle = GDI32.CreateBrushIndirect(ref fLogBrush);
SetHandle(brushHandle);
}
示例13: GetBitmap
// Get the bitmap corresponding to a particular hatch style.
private static IntPtr GetBitmap(HatchStyle style)
{
IntPtr bitmap;
// See if we have a cached bitmap for this style.
if(((int)style) >= 0 && ((int)style) <= 52)
{
if (hatchBitmaps == null)
{
hatchBitmaps = new IntPtr[53];
}
bitmap = hatchBitmaps[(int)style];
if (bitmap != IntPtr.Zero)
{
return bitmap;
}
}
else
{
return IntPtr.Zero;
}
// Get the raw bits for the hatch bitmap.
byte[] bits = GetBits(style);
if(bits == null)
{
return IntPtr.Zero;
}
// Create the bitmap, cache it for later, and then return it.
Array.Reverse(bits);
bitmap = Win32.Api.CreateBitmap(16, 16, 1, 1, bits);
hatchBitmaps[(int)style] = bitmap;
return bitmap;
}
示例14: Win32CreateHatchBrush
internal extern static IntPtr Win32CreateHatchBrush(HatchStyle fnStyle, IntPtr color);
示例15: CalculateValues
public override void CalculateValues()
{
foreach (string name in Properties.Keys)
{
string value = Properties[name];
switch (name)
{
case "background-color":
_backgroundColor = ParseColor(value);
break;
case "shape":
_shape = (ShapeStyle)Enum.Parse(typeof(ShapeStyle), value);
break;
case "color":
_foregroundColor = ParseColor(value);
break;
case "border-style":
_borderStyle = (BorderStyle)Enum.Parse(typeof(BorderStyle), value);
break;
case "border-width":
_borderWidth = float.Parse(value, CultureInfo.InvariantCulture);
break;
case "border-color":
_borderColor = ParseColor(value);
break;
case "fill-style":
_fillStyle = (FillStyle)Enum.Parse(typeof(FillStyle), value);
break;
case "hatch-style":
_hatchStyle = (HatchStyle)Enum.Parse(typeof(HatchStyle), value);
break;
case "width":
_width = float.Parse(value, CultureInfo.InvariantCulture);
break;
case "height":
_height = float.Parse(value, CultureInfo.InvariantCulture);
break;
case "alpha":
_alpha = int.Parse(value, CultureInfo.InvariantCulture);
break;
}
}
}