本文整理汇总了C#中System.Drawing.TextureBrush.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# TextureBrush.Clone方法的具体用法?C# TextureBrush.Clone怎么用?C# TextureBrush.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.TextureBrush
的用法示例。
在下文中一共展示了TextureBrush.Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Dispose_Clone
public void Dispose_Clone ()
{
TextureBrush t = new TextureBrush (image);
t.Dispose ();
t.Clone ();
}
示例2: Draw2
/// <summary>
/// ��·
/// </summary>
/// <param name="g"></param>
/// <param name="time"></param>
private void Draw2(Graphics g, int time)
{
if (base.DrawVisible) {
Matrix matrix1 = base.Transform.Matrix.Clone();
GraphicsContainer container1 = g.BeginContainer();
g.SmoothingMode = base.OwnerDocument.SmoothingMode;
Matrix matrix2 = base.GraphTransform.Matrix.Clone();
base.GraphTransform.Matrix.Multiply(matrix1, MatrixOrder.Prepend);
ClipAndMask.ClipPath.Clip(g, time, this);
bool flag1 = base.Visible;
if (!base.Visible) {
g.SetClip(Rectangle.Empty);
}
float single1 = this.StrokeOpacity;
if (this.svgAnimAttributes.ContainsKey("fill-opacity")) {
single1 = Math.Min(single1, (float)this.svgAnimAttributes["fill-opacity"]);
}
ISvgBrush brush1 = this.GraphBrush;
using (GraphicsPath path1 = (GraphicsPath)this.GPath.Clone()) {
path1.Transform(base.GraphTransform.Matrix);
if (!base.ShowBound) {
float width1 = Width * GraphTransform.Matrix.Elements[0];
Stroke stroke = Stroke.GetStroke(this);
Color color1 = Color.FromArgb(75, 75, 75);
if (stroke.StrokeColor.ToArgb()!=Color.Black.ToArgb()) color1 = stroke.StrokeColor;
using (Pen p = new Pen(Color.FromArgb((int)(single1 * 255), color1))) {
p.Width = width1;
g.DrawPath(p, path1);
}
if (LineType == "3") {
using (Pen p = new Pen(Color.Yellow)) {
if (width1 > 30)
p.Width = 2;
else
p.Width = 1;
//p.DashPattern = new float[] { 10, 10 };
g.DrawPath(p, path1);
}
} else {
//using (Pen p = new Pen(Color.Yellow)) {
// if (width1 > 30)
// p.Width = 2;
// else
// p.Width = 1;
// g.DrawPath(p, path1);
//}
}
if (LineType == "4") {
using (Pen p = new Pen(Color.FromArgb((int)(single1*255),color1))) {
p.Width = width1;
float f22 = width1 / 4f;
ImageAttributes imageAttributes = new ImageAttributes();
ColorMatrix cmatrix1 = new ColorMatrix();
cmatrix1.Matrix00 = 1f;
cmatrix1.Matrix11 = 1f;
cmatrix1.Matrix22 = 1f;
cmatrix1.Matrix33 = single1;//����
cmatrix1.Matrix44 = 1f;
//��������
imageAttributes.SetColorMatrix(cmatrix1, ColorMatrixFlag.Default, ColorAdjustType.Default);
if (BackgroundImage == null) BackgroundImageFile = "road.png";
TextureBrush tbush = new TextureBrush(BackgroundImage,new Rectangle(0,0,BackgroundImage.Width,BackgroundImage.Height),imageAttributes);
tbush.WrapMode = WrapMode.Tile;
for (int i = 0; i < path1.PointCount - 1;i++ ) {
float k = (path1.PathPoints[i+1].Y - path1.PathPoints[i].Y) / (path1.PathPoints[i+1].X - path1.PathPoints[i].X);
float y1 = path1.PathPoints[i].Y - path1.PathPoints[i+1].Y;
float y2 = path1.PathPoints[i].X - path1.PathPoints[i+1].X;
float k2 = (float)Math.Abs(k);
float angle = (float)Math.Atan(k2) * 180 / (float)Math.PI;
if (k < 0) { angle = 360-angle; }
PointF[] pts = new PointF[] { new PointF(path1.PathPoints[i].X, path1.PathPoints[i].Y - 26) };
Matrix matrix11 = new Matrix();
matrix11.RotateAt(angle, path1.PathPoints[i]);
matrix11.Translate(path1.PathPoints[i].X, path1.PathPoints[i].Y);
matrix11.Scale(width1 / 50, width1 / 50);
//tbush.ScaleTransform(width1 / 50, width1 / 50, MatrixOrder.Append);
//tbush.RotateTransform(angle, MatrixOrder.Append);
//tbush.TranslateTransform(path1.PathPoints[i].X, path1.PathPoints[i].Y , MatrixOrder.Append);
tbush.Transform = matrix11;
p.Brush = tbush.Clone() as TextureBrush;
p.Alignment = PenAlignment.Center;
g.DrawLine(p, path1.PathPoints[i], path1.PathPoints[i + 1]);
tbush.ResetTransform();
}
}
//.........这里部分代码省略.........
示例3: Clone
public void Clone ()
{
TextureBrush t = new TextureBrush (image);
TextureBrush clone = (TextureBrush) t.Clone ();
Common (clone, t.WrapMode);
}