コード例 #1
0
ファイル: FigureControls.cs プロジェクト: djpnewton/ddraw
 public BitmapGlyph(DBitmap bmp, DGlyphPosition pos)
 {
     this.bmp = bmp;
     Position = pos;
 }
コード例 #2
0
ファイル: FigureControls.cs プロジェクト: djpnewton/ddraw
 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);
 }
コード例 #3
0
ファイル: FigureControls.cs プロジェクト: djpnewton/ddraw
 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);
 }
コード例 #4
0
ファイル: FigureControls.cs プロジェクト: djpnewton/ddraw
 public void CenterStack(int total, int index)
 {
     if (total == 1)
         pos = DGlyphPosition.Center;
     else
     {
         centerStackTotal = total;
         centerStackIndex = index;
         pos = DGlyphPosition.CenterStack;
     }
 }