`
bit6211
  • 浏览: 73219 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

drawString(String messagetr, int x, int y, int anchor);函数anchor参数备忘

 
阅读更多

     在LGame中,LGraphics类的public void drawString(String messagetr, int x, int y, int anchor);函数中,最后一个anchor参数指的是锚点,起到定位的作用,而“x”,“y”参数指的就是这个锚点的位置了。anchor参数事先规定了一些常量值,这些常量值组合可以定义一些,常用的锚点。如图所示。

锚点组合

  • 大小: 8.4 KB
分享到:
评论
1 楼 lrstom 2011-11-16  
厉害....这样你都能整理出来...不亏是高手

相关推荐

    java五子棋源码

    java编的五子棋 import java.util.*; import java.io.*; import java.awt.*; import java.awt.event.*;... if(x+displace_x>=0 && x+displace_x<length && y+displace_y>=0 && y+displace_y[x+displace_x][y+...

    程序设计基础答案

    A)Void GetSort(float x) B)int GetSort(int y) C)double GetSort(int x,int y) D)void Get(int x,int y) 27.有一个类A,以下为其构造函数的声明,其中正确的是( )。 A)void A(int x){...} B)A(int x){...

    J2ME 简单的游戏选择界面

    简单的游戏选择界面 使用Canvas // 计算整个菜单的高度,宽度和(x,y) int rectWidth = Width;... g.drawString(b[j], x + 8, y + j * Height + 4, Graphics.LEFT | Graphics.TOP); }

    java1think in java笔记(111)---打印 (2008-04-24 16:58:28)

    int x = 0, y = 0; for(int i = 0; i ; i++) { if(x < xc && y ) { g.drawOval(x, y, w, h); x += 10; y += 10; w -= 20; h -= 20; } } } } class Plot2 extends Plot { // To fit the picture to the ...

    Java 语言基础 —— 非常符合中国人习惯的Java基础教程手册

    Point( int x, int y, String name ){ this.x = x; this.y = y; this.name = name; } int getX(){ return x; } int getY(){ return y; } void move( int newX, int newY ){ x = newX; y = newY; } Point newPoint...

    java钟表时钟显示时间

    int x, y, x0, y0, r, h, olds_x, olds_y, oldm_x, oldm_y, oldh_x, oldh_y, ss,mm,hh,old_m,old_h,ang; final double RAD = Math.PI/180; public Clock(){ super("Java时钟"); setDefaultCloseOperation(3);...

    java helloworld java

    int x,y; public void init() { x=8; y=7; } public void paint(Graphics g) {g.drawString("类中定义两个变量:x=8 y=7",50,60); g.drawString("他们的和是: "+(x+y),50,80); g.drawString("他们的差是: "+(x-...

    JAVA中的图形用户界面示例

    protected void record(int x, int y) { lastX = x; lastY = y; } private class PositionRecorder extends MouseAdapter{ public void mouseEntered(MouseEvent e) { requestFocus(); record(e.getX(), e....

    Asp.net动态验证码

    public StringUnit() { // //TODO: 在此处添加构造函数逻辑 // } /// /// 生成随机数 /// /// <returns></returns> private string GenerateCheckCode() { #region int number; char code; ...

    〖程序设计基础〗练习题2及答案

    19. 设 i、j、k 为类 x 中定义的 int 型变量名,下列类 x 的构造函数中不正确的是( )。 A) x( int m){ ... } B) void x( int m){ ... } C) x( int m, int n){ ... } D) x( int h,int m,int n){ ... } 20. 下列方法...

    4位数验证控件,代码可以修改

    private string getRandomValidate(int len) { int num; int tem; string rtuStr = ""; for (int i = 0; i ; i++) { num = ran.Next(); /* * 这里可以选择生成字符和数字组合的验证码 */ tem = num % 10...

    〖程序设计基础〗练习题3及答案

    B) public static int x( double y ){ ... } C) void x( double d ) { ... } D) public static x( double a ){ ... } 22.能从循环语句的循环体中跳出的语句是( )。 A) for 语句 B) break 语句 C) while 语句 D) ...

    飞机大战游戏

    g.drawString(String.valueOf(gb.Sum), a.x - 40, 25); g.setFont(gb.f); // 如果游戏尚未开始显示如下信息 if (gb.hero_hp == -1) { gameNotStart(g); }else if (gb.hero_hp ) { // 如果...

    验证码代码

    RectangleF drawRect = new RectangleF(x + sjx + (k * 25), y + sjy, width, height); StringFormat drawFormat = new StringFormat(); drawFormat.Alignment = StringAlignment.Center; g.DrawString...

    俄罗斯方块

    private int x; private int y; private int i = 0; int j = 0; int flag = 0; // 定义已经放下的方块x=0-11,y=0-21; int[][] map = new int[13][23]; // 方块的形状 第一组代表方块类型有S、Z、L、J、I...

    JSP数据库通用模块开发与系统移植

    g.drawLine(i_x,i_y,i_x+i_xl,i_y+i_yl); } String s_Rand=""; for (int i=0;i;i++) { String rand=String.valueOf(random.nextInt(10)); s_Rand+=rand; g.setColor(new Color(20+random.nextInt(110),20...

    验证码下载jsp

    g.drawString(String.valueOf(code.charAt(rand)),13*i+6,16); } // 将认证码存入SESSION session.setAttribute("rand",sRand); // 图象生效 g.dispose(); // 输出图象到页面 java.io.OutputStream os=response....

    jsp 验证码 控件

    int y=rand.nextInt(height); int x1=rand.nextInt(10); int y1=rand.nextInt(10); g.drawLine(x, y, x1, y1); } g.setFont(new Font("Times New Roman", Font.BOLD + Font.ITALIC, 16)); g....

    ASP.net中的验证码技术

    int x = rand.Next( ImageSize.Width ); int y = rand.Next( ImageSize.Height ); int r = rand.Next( 255 ); int g = rand.Next( 255 ); int b = rand.Next( 255 ); Color c = Color.FromArgb( r , g , ...

Global site tag (gtag.js) - Google Analytics