0

我想知道如何使用 SharpDX 旋转使用 Direct2D 呈现的文本。

找不到任何可能性

RenderTarget2D.DrawText()

或者

RenderTarget2D.DrawTextLayout()

4

1 回答 1

3

您可以使用Transformation Matrix更精确的 -通过 3x2 矩阵的旋转变换。

伪示例:

RenderTarget2D.BeginDraw;
try
  // your regular drawings
  ....

  // save the current tranform
  currentTransform = RenderTarget2D.GetTransform;

  // set a 90 degree rotation around the (100,100);
  RenderTarget2D.SetTransform(Matrix3x2F.Rotation(90, Point2F(100,100))); 

  // do your rotated text drawings
  RenderTarget2D.DrawText();

  // restore your previous/original transform
  RenderTarget2D.SetTransform(currentTransform);
finally
  RenderTarget2D.EndDraw;
end;
于 2015-02-11T18:33:53.753 回答