Jump to content
  • Advertisement

Archived

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

[java] createImage

This topic is 6086 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

hallo I''m having a tad of a problem with games that creates an image out of a array of pixels. it seems that the time it takes to create the image differes radically from frame to frame.anyone has any explanations or tips and tricks? thanks. (it seems to make no difference if I flush the image instead of creating a new one every frame. i use the directcolormodel.) "any help would be... helpful".

Share this post


Link to post
Share on other sites
Advertisement
I''m assuming they are all the same size.

Use MemoryImageSource and don''t both with the createImage. You should have ONE allocated array for all frames, update the int[] array and then call setPixels in memoryImageSource and then paint with your memoryImageSource object.

If you want to see how it works search for TinyPTC +java it''s about a page long class that handles most of the work for you.

Share this post


Link to post
Share on other sites
Oh... btw...

MemoryImageSource works great in the browser ( or other 1.1.X jvm ) but sucks under Java2 ( 1.2+ ). For Java2 you must use BufferedImages to get a decent speed on image manupulation.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!