Example #1
0
		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);
 }
Example #3
0
		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;
		}
Example #4
0
        public static AffineTransform NewIdentity()
		{
            AffineTransform newAffine = new AffineTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);

			return newAffine;
		}
Example #5
0
        public static AffineTransform operator *(AffineTransform a, AffineTransform b)
		{
            AffineTransform temp = new AffineTransform(a);
			temp.Multiply(b);
			return temp;
		}
Example #6
0
        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;
		}
Example #7
0
File: Font.cs Project: Orvid/Cosmos
 public abstract void Render(Image i, BoundingBox clip, AffineTransform trans, string text, Vec2 loc, Pixel color);
Example #8
0
 /// <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);
Example #9
0
        public static AffineTransform NewIdentity()
        {
            AffineTransform newAffine = new AffineTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);

            return(newAffine);
        }