Esempio n. 1
0
 public BitmapGlyph(DBitmap bmp, DGlyphPosition pos)
 {
     this.bmp = bmp;
     Position = pos;
 }
Esempio n. 2
0
 protected DRect GetRect(DGlyphPosition pos, DRect figureRect, double scale)
 {
     DPoint pt = GetXYPosition(pos, figureRect, scale);
     return new DRect(pt.X, pt.Y, Width * scale, Height * scale);
 }
Esempio n. 3
0
 protected DPoint GetXYPosition(DGlyphPosition pos, DRect figureRect, double scale)
 {
     double x = 0, y = 0;
     switch (pos)
     {
         case DGlyphPosition.TopRight:
             x = figureRect.Right - Width * scale;
             y = figureRect.Top;
             break;
         case DGlyphPosition.BottomLeft:
             x = figureRect.Left;
             y = figureRect.Bottom - Height * scale;
             break;
         case DGlyphPosition.Center:
             x = figureRect.Center.X - Width / 2 * scale;
             y = figureRect.Center.Y - Height / 2 * scale;
             break;
         case DGlyphPosition.CenterStack:
             x = figureRect.Center.X - Width / 2 * scale;
             y = figureRect.Center.Y - Height / 2 * scale;
             double stackX = centerStackIndex * Width * scale;
             x += stackX;
             break;
     }
     return new DPoint(x, y);
 }
Esempio n. 4
0
 public void CenterStack(int total, int index)
 {
     if (total == 1)
         pos = DGlyphPosition.Center;
     else
     {
         centerStackTotal = total;
         centerStackIndex = index;
         pos = DGlyphPosition.CenterStack;
     }
 }