如果我写一下有关《维也纳条约法公约》的一段话,就是指某一字体/型号中的“这一案文”,那么我想个人指针。 是否有办法获得同样的东西?
个人用品 SWT案文中含有植被
原标题:Obtain x,y coords of individual Chars in a SWT text widget
问题回答
Text text = new Text(parent, SWT.NONE);
text.setText("This");
GC gc = new GC(text);
int currentPixelsX = text.getBounds().x;
int currentPixelsY = text.getBounds().y;
for (int i = 0; i < text.getText().length(); i++) {
System.out.println("X co-ordinate of " + text.getText().charAt(i) + ":" + currentPixelsX);
System.out.println("Y co-ordinate of " + text.getText().charAt(i) + ":" + currentPixelsY);
currentPixelsX = currentPixelsX + gc.getCharWidth(text.getText().charAt(i));
}
这使同文箱的母体有关的六氯 co。
Probable this Snippet可帮助您计算个人特性的长短。
相关问题
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding