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.