本文整理汇总了C#中Shape.getPathIterator方法的典型用法代码示例。如果您正苦于以下问题:C# Shape.getPathIterator方法的具体用法?C# Shape.getPathIterator怎么用?C# Shape.getPathIterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shape
的用法示例。
在下文中一共展示了Shape.getPathIterator方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: append
public void append(Shape s, bool connect)
{
PathIterator pi = s.getPathIterator (null);
append (pi,connect);
}
示例2: ExtendedGeneralPath
public ExtendedGeneralPath(Shape s) : this(WIND_NON_ZERO, INIT_SIZE, INIT_SIZE)
{
PathIterator pi = s.getPathIterator (null);
setWindingRule (pi.getWindingRule ());
append (pi, false);
}
示例3: writeShape
public static void writeShape(Shape shape, ObjectOutputStream stream)
{
if (stream == null)
{
string str = "Null 'stream' argument.";
Throwable.__\u003CsuppressFillInStackTrace\u003E();
throw new IllegalArgumentException(str);
}
else if (shape != null)
{
stream.writeBoolean(false);
if (shape is Line2D)
{
Line2D line2D = (Line2D) shape;
stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Line2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Line2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Line2D = SerialUtilities.class\u0024("java.awt.geom.Line2D")));
stream.writeDouble(line2D.getX1());
stream.writeDouble(line2D.getY1());
stream.writeDouble(line2D.getX2());
stream.writeDouble(line2D.getY2());
}
else if (shape is Rectangle2D)
{
Rectangle2D rectangle2D = (Rectangle2D) shape;
stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Rectangle2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Rectangle2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Rectangle2D = SerialUtilities.class\u0024("java.awt.geom.Rectangle2D")));
stream.writeDouble(((RectangularShape) rectangle2D).getX());
stream.writeDouble(((RectangularShape) rectangle2D).getY());
stream.writeDouble(((RectangularShape) rectangle2D).getWidth());
stream.writeDouble(((RectangularShape) rectangle2D).getHeight());
}
else if (shape is Ellipse2D)
{
Ellipse2D ellipse2D = (Ellipse2D) shape;
stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Ellipse2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Ellipse2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Ellipse2D = SerialUtilities.class\u0024("java.awt.geom.Ellipse2D")));
stream.writeDouble(((RectangularShape) ellipse2D).getX());
stream.writeDouble(((RectangularShape) ellipse2D).getY());
stream.writeDouble(((RectangularShape) ellipse2D).getWidth());
stream.writeDouble(((RectangularShape) ellipse2D).getHeight());
}
else if (shape is Arc2D)
{
Arc2D arc2D = (Arc2D) shape;
stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Arc2D != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Arc2D : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024Arc2D = SerialUtilities.class\u0024("java.awt.geom.Arc2D")));
stream.writeDouble(((RectangularShape) arc2D).getX());
stream.writeDouble(((RectangularShape) arc2D).getY());
stream.writeDouble(((RectangularShape) arc2D).getWidth());
stream.writeDouble(((RectangularShape) arc2D).getHeight());
stream.writeDouble(arc2D.getAngleStart());
stream.writeDouble(arc2D.getAngleExtent());
stream.writeInt(arc2D.getArcType());
}
else if (shape is GeneralPath)
{
stream.writeObject(SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024GeneralPath != null ? (object) SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024GeneralPath : (object) (SerialUtilities.class\u0024java\u0024awt\u0024geom\u0024GeneralPath = SerialUtilities.class\u0024("java.awt.geom.GeneralPath")));
PathIterator pathIterator = shape.getPathIterator((AffineTransform) null);
float[] numArray = new float[6];
stream.writeBoolean(pathIterator.isDone());
while (!pathIterator.isDone())
{
int num = pathIterator.currentSegment(numArray);
stream.writeInt(num);
for (int index = 0; index < 6; ++index)
stream.writeFloat(numArray[index]);
stream.writeInt(pathIterator.getWindingRule());
pathIterator.next();
stream.writeBoolean(pathIterator.isDone());
}
}
else
{
stream.writeObject((object) Object.instancehelper_getClass((object) shape));
stream.writeObject((object) shape);
}
}
else
stream.writeBoolean(true);
}
示例4: createStrokedShape
/**
* Returns a <code>Shape</code> whose interior defines the
* stroked outline of a specified <code>Shape</code>.
* @param s the <code>Shape</code> boundary be stroked
* @return the <code>Shape</code> of the stroked outline.
*/
public Shape createStrokedShape(Shape s) {
FillAdapter filler = new FillAdapter();
PathStroker stroker = new PathStroker(filler);
PathConsumer consumer;
stroker.setPenDiameter(width);
switch (_penFit) {
case PenFit.Thin:
stroker.setPenFitting(PenUnits, MinPenUnits);
break;
case PenFit.ThinAntiAlias:
stroker.setPenFitting(PenUnits, MinPenUnitsAA);
break;
}
float[] t4 = null;
if (PenTransform != null && !PenTransform.isIdentity() && (PenTransform.getDeterminant() > 1e-25)) {
t4 = new float[]{
(float)PenTransform.getScaleX(), (float)PenTransform.getShearY(),
(float)PenTransform.getShearX(), (float)PenTransform.getScaleY()
};
}
float[] t6 = null;
if (OutputTransform != null && !OutputTransform.isIdentity()) {
t6 = new float[] {
(float)OutputTransform.getScaleX(), (float)OutputTransform.getShearY(),
(float)OutputTransform.getShearX(), (float)OutputTransform.getScaleY(),
(float)OutputTransform.getTranslateX(), (float)OutputTransform.getTranslateY()
};
}
stroker.setPenT4(t4);
stroker.setOutputT6(t6);
stroker.setCaps(RasterizerCaps[cap]);
stroker.setCorners(RasterizerCorners[join], miterlimit);
if (dash != null) {
PathDasher dasher = new PathDasher(stroker);
dasher.setDash(dash, dash_phase);
dasher.setDashT4(t4);
consumer = dasher;
} else {
consumer = stroker;
}
PathIterator pi = s.getPathIterator(null);
try {
consumer.beginPath();
bool pathClosed = false;
float mx = 0.0f;
float my = 0.0f;
float[] point = new float[6];
while (!pi.isDone()) {
int type = pi.currentSegment(point);
if (pathClosed == true) {
pathClosed = false;
if (type != PathIterator__Finals.SEG_MOVETO) {
// Force current point back to last moveto point
consumer.beginSubpath(mx, my);
}
}
switch ((GraphicsPath.JPI)type) {
case GraphicsPath.JPI.SEG_MOVETO:
mx = point[0];
my = point[1];
consumer.beginSubpath(point[0], point[1]);
break;
case GraphicsPath.JPI.SEG_LINETO:
consumer.appendLine(point[0], point[1]);
break;
case GraphicsPath.JPI.SEG_QUADTO:
// Quadratic curves take two points
consumer.appendQuadratic(point[0], point[1],
point[2], point[3]);
break;
case GraphicsPath.JPI.SEG_CUBICTO:
// Cubic curves take three points
consumer.appendCubic(point[0], point[1],
point[2], point[3],
point[4], point[5]);
break;
case GraphicsPath.JPI.SEG_CLOSE:
consumer.closedSubpath();
pathClosed = true;
break;
}
pi.next();
}
consumer.endPath();
} catch (PathException e) {
throw new InternalError("Unable to Stroke shape ("+
//.........这里部分代码省略.........
示例5: createTransformedShape
public Shape createTransformedShape(Shape src)
{
if (src == null)
{
return null;
}
if (src is GeneralPath)
{
return ((GeneralPath)src).createTransformedShape(this);
}
PathIterator path = src.getPathIterator(this);
GeneralPath dst = new GeneralPath(path.getWindingRule());
dst.append(path, false);
return dst;
}
示例6: append
public void append(Shape shape, bool connect)
{
PathIterator p = shape.getPathIterator(null);
append(p, connect);
}
示例7: GeneralPath
public GeneralPath(Shape shape)
: this(WIND_NON_ZERO, BUFFER_SIZE)
{
PathIterator p = shape.getPathIterator(null);
setWindingRule(p.getWindingRule());
append(p, false);
}