How to draw rotated text inside of a GC

喜夏-厌秋 提交于 2020-02-06 07:29:45

问题


I doing some 2D drawing in a SWT GUI. For that I have a GC Object.

How can I draw rotatet text inside of an SWT Canvas?


回答1:


This should do it:

Transform tr = new Transform(display);
tr.rotate(-90);
gc.setTransform(tr);

gc.drawText("Text", x, y);


来源:https://stackoverflow.com/questions/12618023/how-to-draw-rotated-text-inside-of-a-gc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!