How to use Graphics.VCENTER|Graphics.HCENTER

by manohar » Wed, 24 Jun 2009 20:11:37 GMT

Sponsored Links
 Hi All

I am porting a game from J2ME to Android. In J2ME the code is as
g.drawImage(image,x,y,Graphics.HCENTER | Graphics.VCENTER)

In android i have written has

g.drawBitmap(image, x, y, paintObject);

Here i do not have a ooption to specify the anchor position.  Can any
one pls tell me how to specifiy anchor position in andorid. By defult
in andorid it is taking as Graphics.LEFT | Graphics.TOP.

pls help

Other Threads

1. Button On Map

Currently I have a MapView and an Itemized overlay which displays
different locations on the map.

When one of these locations is "tapped" the onTap method creates a new
Overlay object which draws an empty speech bubble (the type you would
find normally on google maps).

What I want to do is then populate this empty speech bubble with some
buttons but I am unsure how to do the following:

1) Get a reference to a button from an xml file in the Overlay class
( can't use findViewById() as it isn't an Activity? ).

2) Pin a button so it stays with the speech bubble.

Would it be best to create a new layout which contains buttons and
place this over the speech bubble? Is that even possible?

2. How is android's AlertDialog layout define?

Thank you for both of your answers.

In the android source, it has:

 * If you
 * want to display a more complex view, look up the FrameLayout called "body"
 * and add your view to it:
 * <pre>
 * FrameLayout fl = (FrameLayout) findViewById(;
 * fl.add(myView, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
 * </pre>

How can I hook up to that?
Do I need to create a layout xml file with 'body' as it name?
And how can I make an AlertDialog loads that layout xml?

Thank you.


3. How is android's AlertDialog layout define?

4. How to keep focus highlight on ExpandableList group....

5. local variable type mismatch

6. WebView and Button in layout, only one of them can be clicked.

7. More than one package in my project on pre 1.5 sdk