Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

Creating a bitmap based font engine

Thread view: 
Gabriel Leblanc - 23 Jan 2004 18:59 GMT
Hey,

Im trying to create a font engine for a simple game.  The way Im
planning to do this, is have a bitmaps representing squared-size
letters, and have the game display only the part needed on the screen.

For example, say I have a 400x300 bitmaps, and every letter is
10x10... then if I want to display 'B' on the screen, I would want to
copy font.bmp, but only pixels in the rectangle 10,0 to 20,10... Any
idea how I could do that ?

Thanks !
ak - 23 Jan 2004 19:16 GMT
> For example, say I have a 400x300 bitmaps, and every letter is
> 10x10... then if I want to display 'B' on the screen, I would want to
> copy font.bmp, but only pixels in the rectangle 10,0 to 20,10... Any
> idea how I could do that ?

you have 2 possibilities:
1. use MemoryImageSource - then you work just with raw data from byte or int
array
2. use BufferedImage#getRGB()

____________

http://reader.imagero.com the best java image reader.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.