Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] GF4J

Started by WyvernSkyraiders Jun 2, 2002 at 4:27 PM 1 replies 650+ views
Original Post
WyvernSkyraiders
WyvernSkyraiders
Is there a way of using a DrawableBitmap (GF4J) without having to redraw it for each frame? What I want to do is to draw a bunch of lines onto a DrawableBitmap once, and then copy it onto the backbuffer for each frame (for speed purpose). But it seems like the DrawableBitmap clears itself after being drawn onto the backbuffer... any solutions? And at the same time, does any know if it''s possible to use pure Java2D funtions in combinaison with GF4J?
nonnus29
nonnus29
if you create the Drawable Bitmap in Video memory by setting the flag to "true" in .createDrawableBitmap, then it is just that, volatile and its not guranteed to stay there. Go into MS Paint and make a .bmp of what you want and voila, case closed.

Use GraphicsEngine.GetBackbufferGraphics to get the Graphics and you can use any of the drawing functions ie drawstring, drawline, drawRect ect...

I like GF4J but I made an applet with it and it wieghed in at ~800kb (!) a little big since I wanna target dial-up people...
WyvernSkyraiders
WyvernSkyraiders
I can''t use Paint to draw my bitmap since the lines I draw are dynamically generated...and i''m not sure there are functions to write DrawableBitmap on the hard disk.

If a DrawableBitmap would be readable then the only thing I would have to do would be to write the dynamically generated bitmap onto my hard disk, and then read it as a normal Bitmap.
But unfortunetly...we can''t access the data of a DrawableBitmap.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.