• Post Reply Bookmark Topic Watch Topic
  • New Topic

Splash Screen

 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have an application where a splash screen comes and go away in 3 secs, it is having a image as well. The problem I am having is I can not get the image to the center of the screen in all models, specially in the nokia phones with different screen sizes, So could you please let me know how to do this. Thank you very much...
 
sivaramakrishna kasimahanthi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this

g.drawImage( imgObj,
getWidth()/2,
getHeight/2,
Graphics.HCENTER | Graphics.VCENTER
);

I assume
g is Graphics Object
imgObj is your image
getWidth will return the widht of the current canvas.
getHeight will return the height of thd cureent cavas.
and the 4th parameter specifies the anchor position.

Hope this will work for you.
 
Ransika deSilva
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the answer, it work, Thanks a lot once again....
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!