/// <summary> /// Constructor. /// </summary> /// <param name="text">Text to view.</param> /// <param name="font">Text font.</param> /// <param name="stringFormat">String format text.</param> public Text(string text, Font font, StringFormat stringFormat) { if (text != string.Empty) { _displayedText = text; } _font = font; _stringFormat = stringFormat; Geometric.AddString(text, _font.FontFamily, (int)_font.Style, _font.Size, Geometric.GetBounds(), _stringFormat); this.Transformer.RotateOccurred += new RotateHandler(Transformer_RotateOccurred); }
/// <summary> /// Constructor. /// </summary> /// <param name="text">Text to view.</param> /// <param name="font">Text font.</param> /// <param name="stringFormat">String format text.</param> public Text(string text, Font font, StringFormat stringFormat) { if (text != string.Empty) { _displayedText = text; } this.Locked = true; _font = font; _stringFormat = stringFormat; Geometric.AddString(text, _font.FontFamily, (int)_font.Style, _font.Size, Geometric.GetBounds(), _stringFormat); // Geometric.FillMode = System.Drawing.Drawing2D.FillMode.Winding; this.Transformer.RotateOccurred += new RotateHandler(Transformer_RotateOccurred); }
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; }
/// <summary> /// Default constructor. /// </summary> public Text() { Geometric.AddString(_displayedText, _font.FontFamily, (int)_font.Style, _font.Size, Geometric.GetBounds(), _stringFormat); this.Transformer.RotateOccurred += new RotateHandler(Transformer_RotateOccurred); }