public AffineTransform(AffineTransform copyFrom) { sx = copyFrom.sx; shy = copyFrom.shy; shx = copyFrom.shx; sy = copyFrom.sy; tx = copyFrom.tx; ty = copyFrom.ty; }
public override void DrawText(Image i, BoundingBox clip, AffineTransform trans, string s, Font f, Vec2 Loc, Pixel p) { f.Render(i, clip, trans, s, Loc, p); }
public void Scaling(out double x, out double y) { double x1 = 0.0; double y1 = 0.0; double x2 = 1.0; double y2 = 1.0; AffineTransform t = new AffineTransform(this); t *= NewRotation(-Rotation()); t.Transform(ref x1, ref y1); t.Transform(ref x2, ref y2); x = x2 - x1; y = y2 - y1; }
public static AffineTransform NewIdentity() { AffineTransform newAffine = new AffineTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0); return newAffine; }
public static AffineTransform operator *(AffineTransform a, AffineTransform b) { AffineTransform temp = new AffineTransform(a); temp.Multiply(b); return temp; }
void Multiply(AffineTransform m) { double t0 = sx * m.sx + shy * m.shx; double t2 = shx * m.sx + sy * m.shx; double t4 = tx * m.sx + ty * m.shx + m.tx; shy = sx * m.shy + shy * m.sy; sy = shx * m.shy + sy * m.sy; ty = tx * m.shy + ty * m.sy + m.ty; sx = t0; shx = t2; tx = t4; }
public abstract void Render(Image i, BoundingBox clip, AffineTransform trans, string text, Vec2 loc, Pixel color);
/// <summary> /// Draw the specified Text, using the specified Font, /// in the specified Color, within the specified Bounds, /// at the specified Location, and on the specified image, /// making sure to take the transform into account. /// </summary> /// <param name="i">The Image to draw on.</param> /// <param name="clip">The BoundingBox to clip to.</param> /// <param name="trans">The Transform to apply.</param> /// <param name="s">The String to draw.</param> /// <param name="f">The Font to draw in.</param> /// <param name="Loc">The Location to draw at.</param> /// <param name="p">The Color to draw in.</param> public abstract void DrawText(Image i, BoundingBox clip, AffineTransform trans, String s, Font f, Vec2 Loc, Pixel p);
public static AffineTransform NewIdentity() { AffineTransform newAffine = new AffineTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0); return(newAffine); }