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; }