Results 1 to 9 of 9
- 09-18-2011, 08:16 AM #1
Setting the contrast / Darkening images.
I finally found a great way that I want to use for adding nighttime to my game.
Unfortunately, I could only find how to change the contrast / darken a bufferedImage, I'd like to do it with an ImageIcon / Icon if possible.
Works fine with doing it with an "Image" as well.
Thanks,
AhCurrently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
- 09-18-2011, 08:24 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
Re: Setting the contrast / Darkening images.
Have a look at the ImageIO class and the ImageIcon class and you'll see the difference between an Image and an Icon.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 09-18-2011, 09:24 AM #3
Re: Setting the contrast / Darkening images.
It does'nt matter because I have both an Image array & an Icon array holding the same images.
The Images are made into Icons.
So, anyway. Is it possible to change the contrast / darken the Images or the Icons?Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
- 09-18-2011, 10:00 AM #4
Re: Setting the contrast / Darkening images.
No you don't. An Icon array can hold Icons, not Images.I have both an Image array & an Icon array holding the same images.
What result did you get when you changed the brightness of an image (BufferedImage) that belongs to an ImageIcon?
db
- 09-18-2011, 10:07 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
- 09-20-2011, 08:02 PM #6
Re: Setting the contrast / Darkening images.
Jos,
I know exactly how to handle Icons & Images,
First I am creating Images which I am cutting into different parts like a texture pack.
Then I am changing them into Icons.
Everything is done my a for loop.
It takes up 7 rows of my code,
I would not call it a waste of space.
Kind,
Regards Ah
Btw, you should ask me before telling me that my code is bad.
In order to know that my code is bad, you have to see it.
Now,
Learn from this & help me with my question.Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
- 09-20-2011, 08:39 PM #7
Re: Setting the contrast / Darkening images.
think he didn't meant that your code will not work... but just isn't memory efficient...
so just useing more memory then needed...
ps why not use those bufferedImages class then? since that class has the method?
- 09-21-2011, 04:30 PM #8
Re: Setting the contrast / Darkening images.
The problem is that I am not familiar at all with the bufferedImages.
I've tried to read it up, but I did'nt really get it to work.
Thanks,
Ah
Btw,
I will read the API for it and see if I can find anything of interrest.
If you guys have ay tips for it, then please tell me.Currently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
- 09-21-2011, 04:52 PM #9
Re: Setting the contrast / Darkening images.
This time I think that I'll actually need the code for it.
Thanks,
AhCurrently Developing a Game Called Loaie, You Can Download It From "The Loaie Website".
Similar Threads
-
how to mark on 2 images at a time,both images are on different JPanel
By smitharavi in forum AWT / SwingReplies: 0Last Post: 12-16-2010, 05:14 PM -
how to scroll 2 images at a time(synchronisation),both images are on different panels
By smitharavi in forum AWT / SwingReplies: 4Last Post: 12-16-2010, 04:32 PM -
Auto contrast and auto brightness
By oxxxis in forum Java 2DReplies: 0Last Post: 01-21-2010, 08:32 PM -
Setting the DSN
By tim in forum JDBCReplies: 1Last Post: 02-14-2008, 09:55 PM -
Help with setting up please
By BlitzA in forum New To JavaReplies: 6Last Post: 12-29-2007, 12:54 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks