锚点定位和值
来源:互联网 发布:datacolor软件下载 编辑:程序博客网 时间:2024/05/22 17:14
J2ME画图,以锚点定位,各锚点位置示意图如下:
说明:
1. 通过测试验证:
g.drawString("文字", x, y, 0);
=
g.drawString("文字", x, y, Graphics.LEFT | Graphics.TOP);
0是个默认值,默认的意思就是默认手机空屏时,第一个点可以正常显示的位置,即:Graphics.LEFT | Graphics.TOP
2. 参数“vcenter”为图片专用——这个锚点示意图是以“Image”为例的,当要画的是“String”时,定位参数“vcenter”非法;
3. 定位坐标为 两个参数一组,每组为一个int值,具体的值如下所列;
int a = Graphics.LEFT | Graphics.TOP;
int b = Graphics.LEFT | Graphics.BASELINE;
int c = Graphics.LEFT | Graphics.VCENTER;
int d = Graphics.LEFT | Graphics.BOTTOM;
int e = Graphics.RIGHT | Graphics.TOP;
int f = Graphics.RIGHT | Graphics.BASELINE;
int g = Graphics.RIGHT | Graphics.VCENTER;
int h = Graphics.RIGHT | Graphics.BOTTOM;
int i = Graphics.HCENTER | Graphics.TOP;
int j = Graphics.HCENTER | Graphics.BASELINE;
int k = Graphics.HCENTER | Graphics.VCENTER;
int l = Graphics.HCENTER | Graphics.BOTTOM;
System.out.println("a is : "+a);
System.out.println("b is : "+b);
System.out.println("c is : "+c);
System.out.println("d is : "+d);
System.out.println("e is : "+e);
System.out.println("f is : "+f);
System.out.println("g is : "+g);
System.out.println("h is : "+h);
System.out.println("i is : "+i);
System.out.println("j is : "+j);
System.out.println("k is : "+k);
System.out.println("l is : "+l);
int b = Graphics.LEFT | Graphics.BASELINE;
int c = Graphics.LEFT | Graphics.VCENTER;
int d = Graphics.LEFT | Graphics.BOTTOM;
int e = Graphics.RIGHT | Graphics.TOP;
int f = Graphics.RIGHT | Graphics.BASELINE;
int g = Graphics.RIGHT | Graphics.VCENTER;
int h = Graphics.RIGHT | Graphics.BOTTOM;
int i = Graphics.HCENTER | Graphics.TOP;
int j = Graphics.HCENTER | Graphics.BASELINE;
int k = Graphics.HCENTER | Graphics.VCENTER;
int l = Graphics.HCENTER | Graphics.BOTTOM;
System.out.println("a is : "+a);
System.out.println("b is : "+b);
System.out.println("c is : "+c);
System.out.println("d is : "+d);
System.out.println("e is : "+e);
System.out.println("f is : "+f);
System.out.println("g is : "+g);
System.out.println("h is : "+h);
System.out.println("i is : "+i);
System.out.println("j is : "+j);
System.out.println("k is : "+k);
System.out.println("l is : "+l);
打印结果为:
a is : 20
b is : 68
c is : 6
d is : 36
e is : 24
f is : 72
g is : 10
h is : 40
i is : 17
j is : 65
k is : 3
l is : 33
--End--
- 锚点定位和值
- 导航定位(利用锚点和jquery定位)
- js锚点定位
- js锚点定位
- 锚点定位
- html 锚点定位
- web 锚点定位
- 锚点定位
- 锚点定位
- jquery锚点定位
- jquery锚点定位
- 锚点定位
- 锚点定位
- 四 iOS之图层的定位点和锚点
- js 模仿锚点定位
- js 锚点平滑定位
- js 控制锚点定位
- HTML锚点定位偏移
- google analytics 跟踪所有搜索引擎的设置方法
- js 实现今天的上一周和下一周
- 2010.03.18
- 免安装Oracle客户端使用PL/SQL for Oracle9i ,10g,11g
- Python安装MySQLDb模块的种种问题及解决
- 锚点定位和值
- ISA正则化的含义
- Castle ActiveRecord 学习之 .net快速开发 (1)
- Symbian中的iScanCode和iCode(转)
- ARRAYLIST VECTOR LINKEDLIST 区别与用法
- ISA Server 客户端类型
- 用世界丈量自己的容器
- 感恩的心
- inno setup 功能