Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 2D / Image to BufferedImage on: 2004-06-19 15:31:07
The subject says it all. Can anyone tell me how to convert an Image to a BufferedImage?

Regards,
Igor
2  Game Development / Newbie & Debugging Questions / Reading BMPs in ImageIO on: 2004-06-18 21:02:19
From what I found java.imageio.ImageIO cannot read .bmp files. This is not good for me. Can anyone tell me of a different class that can read BMPs and preferably return a BufferedImage?

Regards,
Igor
3  Java Game APIs & Engines / Java 2D / Re: Transparency on: 2004-06-16 00:47:31
This is what it printed:

1  
DirectColorModel: rmask=ff0000 gmask=ff00 bmask=ff amask=1000000
4  Java Game APIs & Engines / Java 2D / Re: Transparency on: 2004-06-15 20:55:53
Sorry I took a while. The code compiles but throws an exception of type ClassCastException. It's thrown at the line:
1  
IndexColorModel icm = (IndexColorModel)(loadedImage.getColorModel());

can anyone tell me why this is so?
5  Java Game APIs & Engines / Java 2D / Re: Transparency on: 2004-06-14 19:12:13
Thanks Abuse,

Its what I was looking for. One question though... what did you mean when you called "plied()"? Is it a typo? What package do I have to import?
6  Java Game APIs & Engines / Java 2D / Re: Rotate image on: 2004-06-14 17:18:09
Your best bet is probably to just create those rotation images outside your program. Then just load the files during runtime. I just create 8 similar images, each pointing in a different direction.

Regards,
Igor
7  Java Game APIs & Engines / Java 2D / Transparency on: 2004-06-14 17:14:19
Does Java allow you to set a certain color transparent after the image has been loaded into memory? I don’t want to go through all my GIFs and make the background transparent. I remember that C# has a feature where you specify a pixel and its color becomes transparent. Does Java have this? Can anyone post some code?


Regards,
Igor
8  Game Development / Newbie & Debugging Questions / Re: Loading Images on: 2004-06-10 18:04:48
OK Cheesy,

I'm very sorry to have been wasting your time. oNyx you were absolutely right and your advice is worth gold. I can't stop smiling. :-D. I just spent the last 3 days of my summer break on a simple mistake.

When I was saving the images using Microsoft Paint, I would write the following into the name edit box: image.gif. However, I would forget to change the format to gif. Assuming that Microsoft would do so automatically. This was the problem.

Again I apologize for my last 3 posts. Hey at least I learned something in the process.

Regards,
Igor

PS: I'm really not stupid, just 15. So please don't hold my age and inattention to detail against me.


Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy
9  Game Development / Newbie & Debugging Questions / Re: Loading Images on: 2004-06-10 16:06:55
OK, I made some progress. The problem arises when ImageIO calls the getImageReaders() method. I looked inside it but didn't understand what the problem was. Anyway, when it calls getImageReader() the method returns an empty Iterator. This is why it keeps returning null. What file formats does ImageIO support. I was using .gif and thought that it was supported. Can anyone help?

Regards,
Igor
10  Game Development / Newbie & Debugging Questions / Re: Loading Images on: 2004-06-10 15:36:55
It still doesn’t work. When I attempt to load an image that I find on google images it works fine. But when I try to load them from my disk it (ImageIO) returns a null image. I use JBuilder so I put the image in the \classes directory. It (getResource) finds the image but when I pass the URL to ImageIO it still returns a null.

Regards,
Igor
11  Game Development / Newbie & Debugging Questions / Loading Images on: 2004-06-10 15:25:37
I'm having some trouble loading images into my game. The images are currently saved in the directory where my class files are located. I'm using Windows 2000. I call the ClassLoader.getResource() method and it returns a URL that looks something like this: "file:C:/_Work/.../image.gif". Is this a valid URL to pass to the javax.imageio.ImageIO.read function or does the URL have to be an actual http address. I'm not sure that the question makes sense, but can anyone explain how to load images in Java.

Regards,
Igor
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (25 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!