2010-06-04 12 views
1

저는 캔버스에서 가로 문자가 아닌 90º 회전 된 문자열을 그리거나 인쇄하는 방법을 찾는 데 어려움을 겪고 있습니다. 성공하지 못했던 몇 가지 다른 접근법을 통해 Image 객체에 Graphics 객체를 인쇄하는 작업을 수행하려고했습니다. API가 줄어들면서 어려운 작업이었습니다. 그래서 기본적으로 캔버스에서 90도 회전 한 String을 그리는 방법을 아는 경우 또는 그렇지 않은 경우 그래픽 개체를 이미지에 저장하여 "힌트"를 따라갈 수 있습니다. . 대단히 감사합니다!캔버스에 문자열 그리기

Guilherme

+0

저는 이것이 자바 기반이라고 가정합니다. –

+0

죄송합니다, 예! – GuilhermeA

답변

3

마지막으로, 마지막으로 웹에서 연구와 여기 그것은이다에서

//The text that will be displayed 
    String s="java"; 
    //Create the blank image, specifying its size 
    Image img=Image.createImage(50,50); 
    //Create an instance of the image's Graphics class and draw the string to it 
    Graphics gr=img.getGraphics(); 
    gr.drawString(s, 0, 0, Graphics.TOP|Graphics.LEFT); 
    //Display the image, specifying the rotation value. For example, 90 degrees 
    g.drawRegion(img, 0, 0, 50, 50, Sprite.TRANS_ROT90, 0, 0, Graphics.TOP|Graphics.LEFT); 

: http://wiki.forum.nokia.com/index.php/How_to_display_rotated_text_in_Java_ME

감사합니다!