/// <summary> /// Default constructor. /// </summary> public Text() { Geometric.Reset(); Geometric.AddLine(0, 0, 1, 1); //Geometric.AddString(_displayedText, _font.FontFamily, (int)_font.Style, _font.Size, Geometric.GetBounds(), _stringFormat); // Geometric.FillMode = System.Drawing.Drawing2D.FillMode.Winding; this.Transformer.RotateOccurred += new RotateHandler(Transformer_RotateOccurred); ((PolygonAppearance)this.Appearance).BackgroundColor1 = Color.Black; ((PolygonAppearance)this.Appearance).BackgroundColor2 = Color.Black; }
/// <summary> /// Called when a shape is removed. /// </summary> /// <param name="shape">Removed shape.</param> /// <param name="index">Removing index.</param> void _shapes_RemovedItem(IShape shape, int index) { (shape as Shape).Parent = null; Geometric.Reset(); foreach (IShape grouppedShape in _shapes) { Geometric.AddPath(grouppedShape.Geometric, false); } }
/// <summary> /// Mouse down function. /// </summary> /// <param name="document">Informations transferred from DrawingPanel.</param> /// <param name="e">MouseEventArgs.</param> public override void MouseDown(IDocument document, System.Windows.Forms.MouseEventArgs e) { _shape = _memoryShape.Clone() as IShape; Geometric.Reset(); Geometric.AddPath(_shape.Geometric, false); Visible = false; Selected = false; InitializeVersors(_shape.HitTest(e.Location)); base.MouseDown(document, e); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="compositeShape">CompositeShape to copy.</param> public CompositeShape(CompositeShape compositeShape) : base(compositeShape) { Transformer = new CompositeTransformer(this); _shapes.InsertedItem += new ShapeCollection.OnInsertedItem(_shapes_InsertedItem); _shapes.RemovedItem += new ShapeCollection.OnRemovedItem(_shapes_RemovedItem); Geometric.Reset(); foreach (IShape shape in compositeShape.Shapes) { _shapes.Add(shape.Clone() as IShape); } }
/// <summary> /// Copy constructor. /// </summary> /// <param name="ghost">Shape to copy.</param> public Ghost(Ghost ghost) : base(ghost) { _referenceShape = ghost.Shape; _memoryShape = ghost.Shape.Clone() as IShape; _shape = _memoryShape.Clone() as IShape; Geometric.Reset(); Geometric.AddPath(ghost.Shape.Geometric, false); ghost.Selected = false; ghost.Visible = false; this.Transformer.MirrorHorizontalOccurred += new MirrorHorizontalHandler(Transformer_MirrorHorizontalOccurred); this.Transformer.MirrorVerticalOccurred += new MirrorVerticalHandler(Transformer_MirrorVerticalOccurred); this.Appearance = new GhostAppearance(); }
virtual protected void UpdateText() { SizeF oldDimension = Dimension; PointF oldLocation = Location; float oldRotation = Rotation; Geometric.Reset(); Geometric.AddString(_displayedText, _font.FontFamily, (int)_font.Style, _font.Size, Geometric.GetBounds(), _stringFormat); System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix(); matrix.Rotate(_degree); Geometric.Transform(matrix); if (_degree != oldRotation) { base.Rotation = _degree; } base.Dimension = oldDimension; base.Location = oldLocation; }
virtual protected void UpdateText() { //var eee = Geometric.GetBounds(); SizeF oldDimension = Dimension; PointF oldLocation = Location; float oldRotation = Rotation; Geometric.Reset(); // Rectangle WFTitle = new Rectangle(0, 0, bmp.Width, bmp.Height); // Geometric.AddString(_displayedText, _font.FontFamily, (int)_font.Style, _font.Size, Geometric.GetBounds(), _stringFormat); //Geometric.AddString(_displayedText, this.Font.FontFamily, (int)this.Font.Style, this.Font.Size, Geometric.GetBounds(), _stringFormat); Geometric.AddString(_displayedText, this.Font.FontFamily, (int)this.Font.Style, this.Font.Size, new Point(0, 0), _stringFormat); System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix(); matrix.Rotate(_degree); Geometric.Transform(matrix); if (_degree != oldRotation) { base.Rotation = _degree; } base.Dimension = oldDimension; base.Location = oldLocation; }