Jump to content
  • Advertisement
Sign in to follow this  

[java] Help me getting started with Java graphics

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

Im having a hard time creating an application that loadd an image from file into <something>. I dont know what I should use for this "something", BufferedImage or something else!? When the image is loaded i need to have the ability to cut it down in several peaces and copy it into another buffer. I thought that then using a JPanel was enough, but it stored nothing. Help :(

Share this post


Link to post
Share on other sites
Advertisement
Well I got it working with ImageIO and BufferedImage.
The next step: How can I compare a peace within the BufferedImage with anorher peace from the same BufferedImage!?

Also why isnt my Progressbar not updating in a loop!? It 0 and when then loop is finished it 100% :(

Share this post


Link to post
Share on other sites
Do you upgrade your progressbar? It does not update itself if you haven't implemented...

and by comparing, what you really want? compare a pixel? you could use a raster for that... get it from the bufimg...

a question from me to you: what ide you use for dev? notepad? jedit? eclipse?
i prefere eclipse, just because of the autocompletion (there are many more with that feature)... with autocompletion you can just test... test test test... most methods have a very obvious name...

Share this post


Link to post
Share on other sites
Quote:
Original post by capn_midnight
Quote:
Original post by OrangyTang
Look into the ImageIO methods and use a BufferedImage.
ImageIcon is easier.

And wrong. Why pull in Swing classes when all you need is to load an image? Besides, IIRC ImageIO gives you greater control over error handling.

Share this post


Link to post
Share on other sites
Im using Borland JBuilder 2005 (Trial), it works really great I must say. I also have Eclipse and I use it for J2ME development.

Im already ready the raster but I dont know how I can compare those. Do I just do RasterA == RasterB or do I compare each value value in the raster like RasterA[x].get!? == RasterB[x].get!?
Actually im looking for a method to calculate an unique ID for a raster according to the data it contains.

Edit:

I fixed the progressbar with like this
jProgressBar1.update(jProgressBar1.getGraphics());

and enable double buffering.

[Edited by - D3DXVECTOR3 on March 17, 2005 5:30:59 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!