本文整理汇总了C#中System.Drawing.PointF.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# PointF.Clone方法的具体用法?C# PointF.Clone怎么用?C# PointF.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.PointF
的用法示例。
在下文中一共展示了PointF.Clone方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAnimateValue
public static object GetAnimateValue(SvgElement element, string attributename, DomType domtype, object orivalue)
{
PointF[] tfArray6;
PointF[] tfArray7;
PointF[] tfArray8;
int num8;
Matrix matrix1 = new Matrix();
string text1 = string.Empty;
GraphicsPath path1 = null;
string text2 = string.Empty;
PointF[] tfArray1 = null;
bool flag1 = true;
if (element.AnimateNameValues.ContainsKey(attributename))
{
AnimateInfo info1 = (AnimateInfo) element.AnimateNameValues[attributename];
object[] objArray1 = info1.AnimateValues;
bool[] flagArray1 = info1.ValueAdds;
int num1 = 0;
if ((domtype == DomType.SvgString) || (domtype == DomType.SvgLink))
{
for (int num2 = objArray1.Length - 1; num2 >= 0; num2--)
{
if ((objArray1[num2] is string) && (objArray1[num2].ToString() != string.Empty))
{
if (element is ItopVector.Core.Figure.Image)
{
((ItopVector.Core.Figure.Image) element).RefImage = ImageFunc.GetImageForURL(objArray1[num2].ToString(), element);
}
return objArray1[num2].ToString();
}
}
return orivalue;
}
object[] objArray2 = objArray1;
for (int num10 = 0; num10 < objArray2.Length; num10++)
{
PointF[] tfArray2;
float single3;
GraphicsPath path2;
PointF[] tfArray3;
PointF[] tfArray4;
PointF[] tfArray5;
object obj1 = objArray2[num10];
bool flag2 = flagArray1[num1];
switch (domtype)
{
case DomType.SvgMatrix:
{
Matrix matrix2 = new Matrix();
if ((obj1 != null) && (obj1.ToString() != string.Empty))
{
matrix2 = ((Matrix) obj1).Clone();
}
if (flag2)
{
matrix1.Multiply(matrix2);
goto Label_046F;
}
matrix1 = matrix2;
goto Label_046F;
}
case DomType.SvgNumber:
{
single3 = 0f;
if ((obj1 != null) && (obj1.ToString() != string.Empty))
{
single3 = (float) obj1;
if (!flag2 || (text1 == string.Empty))
{
goto Label_0246;
}
float single9 = float.Parse(text1) + single3;
text1 = single9.ToString();
}
goto Label_046F;
}
case DomType.SvgString:
{
goto Label_046F;
}
case DomType.SvgColor:
{
string text3 = string.Empty;
if ((obj1 != null) && (obj1.ToString() != string.Empty))
{
text3 = (string) obj1;
}
if (text3 != string.Empty)
{
if ((flag2 && (text2 != string.Empty)) && (!text2.Trim().StartsWith("url") && !text3.Trim().StartsWith("url")))
{
Color color1 = ColorFunc.ParseColor(text3);
Color color2 = ColorFunc.ParseColor(text2);
int num4 = (color1.R + color2.R) / 2;
int num5 = (color1.G + color2.G) / 2;
int num6 = (color1.B + color2.B) / 2;
string[] textArray1 = new string[7] { "rgb(", num4.ToString(), ",", num5.ToString(), ",", num6.ToString(), ")" } ;
text2 = string.Concat(textArray1);
goto Label_046F;
}
//.........这里部分代码省略.........
示例2: FillPolygon
public void FillPolygon(Brush brush, PointF[] inputPoints)
{
PointF[] points = (PointF[])inputPoints.Clone();
Graphics g = _g;
if (g == null)
{
return;
}
lock (this)
{
for (int i = 0; i < points.Length; i++)
{
Convert(ref points[i]);
}
g.FillPolygon(brush, points);
}
}
示例3: ScaleRotateTranslatePoints
/// <summary>
/// Scale and rotate a graphics path around 0,0 the moves path to the given
/// origin
/// </summary>
/// <param name="gp"></param>
/// <param name="origin"></param>
/// <param name="rotation"></param>
/// <param name="xScale"></param>
/// <param name="yScale"></param>
public static PointF[] ScaleRotateTranslatePoints(PointF[] p0,
PointF origin,
float rotation,
float xScale, float yScale)
{
// create affine transform
Matrix m = new Matrix();
// clone original points
PointF[] p1 = (PointF[])p0.Clone();
// rotate and scale
m.Scale(xScale, yScale, MatrixOrder.Prepend);
m.Rotate(rotation, MatrixOrder.Prepend);
m.Translate(origin.X, origin.Y);
// transform points
m.TransformPoints(p1);
// return points
return p1;
}
示例4: AddBeziers
/// <summary>
/// Adds a sequence of connected cubic Bézier curves to the current figure.
/// </summary>
public void AddBeziers(PointF[] points)
{
if (points.Length < 4)
throw new ArgumentException("At least four points required for bezier curve.", "points");
if ((points.Length - 1) % 3 != 0)
throw new ArgumentException("Invalid number of points for bezier curve. Number must fulfil 4+3n.", "points");
this.items.Add(new XGraphicsPathItem(XGraphicsPathItemType.Beziers, points.Clone() as XPoint[]));
this.dirty = true;
this.gdipPath.AddBeziers(points);
}
示例5: DrawPolygon
public void DrawPolygon(Pen pen, PointF[] inputPoints)
{
PointF[] points = (PointF[])inputPoints.Clone();
Graphics g = _g;
if (g == null)
{
return;
}
lock (this)
{
for (int i = 0; i < points.Length; i++)
{
Convert(ref points[i]);
}
g.DrawPolygon(pen, points);
}
}
示例6: DrawPolygon
public void DrawPolygon(Pen pen, PointF[] inputPoints)
{
PointF[] points = (PointF[])inputPoints.Clone();
lock (this)
{
for (int i = 0; i < points.Length; i++)
{
Convert(ref points[i]);
}
_g.DrawPolygon(pen, points);
}
}
示例7: UpdateGraph
private void UpdateGraph(SvgElement polyline, PointF[] newpoints)
{
if (polyline != null)
{
StringBuilder text1 = new StringBuilder();
PointF[] tfArray1 = (PointF[])newpoints.Clone();
for (int num10 = 0; num10 < tfArray1.Length; num10++)
{
PointF tf1 = tfArray1[num10];
text1.Append( tf1.X.ToString() + " " + tf1.Y.ToString());
if (num10 < (tfArray1.Length - 1))
{
text1.Append(",");
}
}
SvgDocument document1 = this.mouseAreaControl.SVGDocument;
bool flag1 = document1.AcceptChanges;
document1.AcceptChanges = true;
document1.NumberOfUndoOperations = 200;
if (( (((polyline).InfoList.Count == 1) && (this.mouseAreaControl.SVGDocument.ControlTime == 0))) || ((polyline).ParentNode == null))
{
AttributeFunc.SetAttributeValue(polyline, "points", text1.ToString());
}
document1.NotifyUndo();
document1.AcceptChanges = flag1;
}
}
示例8: WorldToView
public void WorldToView(PointF[] worldPts, out PointF[] viewPts)
{
viewPts = (PointF[])worldPts.Clone();
mViewMatrix.TransformPoints(viewPts);
}
示例9: ViewToWorld
/// <summary>
/// Converts the given point array from View coordinates to the absolute World coordinates.
/// </summary>
/// <param name="viewPts">The view PTS.</param>
/// <param name="worldPts">The world PTS.</param>
public void ViewToWorld(PointF[] viewPts, out PointF[] worldPts)
{
worldPts = (PointF[])viewPts.Clone();
//Matrix matrix = GetViewMatrix();
//matrix.Invert();
mInvertedViewMatrix.TransformPoints(worldPts);
}
示例10: digitalizar
///Crea una secuencia de puntos que permita dibujar
///la curva de forma digital. Lo que se hace es
///remuestrear la señal una y otra vez, interpolando puntos
///hasta que se alcanza el grado de mejora;
private PointF[] digitalizar(PointF[] curva, int numMuestras)
{
PointF[] curvaParaDevolver = (PointF[])curva.Clone(); ;
if (numMuestras == curva.Length)
{
return curva;
}
//Al principio toda curva tiene cuatro puntos;
int gradoMejora = 4;
while (gradoMejora != numMuestras)
{
curvaParaDevolver = duplicarMuestras(curvaParaDevolver);
gradoMejora *= 2;
}
return curvaParaDevolver;
}
示例11: ChangeSpecialLocations
// Change the locations associated with a special.
public static void ChangeSpecialLocations(EventDB eventDB, Id<Special> specialId, PointF[] newLocations)
{
Special special = eventDB.GetSpecial(specialId);
special = (Special) special.Clone();
special.locations = (PointF[]) newLocations.Clone();
eventDB.ReplaceSpecial(specialId, special);
}
示例12: Special
public Special(SpecialKind kind, PointF[] locations)
{
this.kind = kind;
this.locations = (PointF[]) locations.Clone();
this.allCourses = true;
}
示例13: docToLocal
/// <summary>
/// Transforms the specified points from document
/// coordinates to coordinates relative to the left-top
/// point of the box.
/// </summary>
private PointF[] docToLocal(PointF[] points)
{
if (points == null)
return null;
PointF[] result = (PointF[])points.Clone();
RectangleF nrect = Utilities.normalizeRect(this.rect);
for (int i = 0; i < result.Length; i++)
{
result[i].X -= nrect.X;
result[i].Y -= nrect.Y;
}
return result;
}
示例14: FillPolygon
public void FillPolygon(Brush brush, PointF[] inputPoints)
{
PointF[] points = (PointF[])inputPoints.Clone();
lock (this)
{
for (int i = 0; i < points.Length; i++)
{
Convert(ref points[i]);
}
_g.FillPolygon(brush, points);
}
}
示例15: ConvertSweepAngle
internal static float ConvertSweepAngle(float sweepAngle, float startAngle, SpatialTransform transform, CoordinateSystem targetSystem)
{
PointF x = new PointF(100, 0);
PointF[] startVector = new PointF[] { x };
Matrix rotation = new Matrix();
rotation.Rotate(startAngle);
rotation.TransformVectors(startVector);
PointF[] sweepVector = (PointF[])startVector.Clone();
rotation.Reset();
rotation.Rotate(sweepAngle);
rotation.TransformVectors(sweepVector);
rotation.Dispose();
SizeF startVectorTransformed, sweepVectorTransformed;
if (targetSystem == Graphics.CoordinateSystem.Destination)
{
startVectorTransformed = transform.ConvertToDestination(new SizeF(startVector[0]));
sweepVectorTransformed = transform.ConvertToDestination(new SizeF(sweepVector[0]));
}
else
{
startVectorTransformed = transform.ConvertToSource(new SizeF(startVector[0]));
sweepVectorTransformed = transform.ConvertToSource(new SizeF(sweepVector[0]));
}
// simply return the angle between the start and sweep angle, in the target system.
return (int)Math.Round(Vector.SubtendedAngle(sweepVectorTransformed.ToPointF(), PointF.Empty, startVectorTransformed.ToPointF()));
}