Anchor location and Value

Source: Internet
Author: User

You can draw a picture by using the j2-based image as the anchor. The positions of the anchor are as follows:

Note:
1. Pass test verification:
G. drawString ("text", x, y, 0 );
=
G. drawString ("text", x, y, Graphics. LEFT | Graphics. TOP );
0 is the default value. The default value is the position that can be normally displayed at the first point when the phone is blank, that is, Graphics. LEFT | Graphics. TOP.

2. The parameter "vcenter" is used for Image purposes. This anchor is based on "Image". If you want to draw a "String", the positioning parameter "vcenter" is invalid;
3. Positioning coordinates are a set of two parameters, each of which is an int value. The specific values are listed below;

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:" + );
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 );

The output is as follows:
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 --

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.