Archived

This topic is now archived and is closed to further replies.

This topic is 5672 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites