Skip to main content
GameDev.net gamedev.net
🔒 Locked

[java] Masking in Java.

Started by -=Code=- Dec 5, 2000 at 4:08 AM 5 replies 850+ views
Original Post
-=Code=-
-=Code=-
I''m not too sure what the exact term for what I''m trying to do is but I think that it might be masking/transparency. You now when your loading a bitmap/GIF and the picture that you want isn''t quite rectangular in shape? How do I make it so that a certain colour is assigned as "tranparent" colour and anything underneath this will be drawn instead?
ToddH
ToddH
What you most likely should do, is use a drawing package that supports transparent gifs, eg paint shop pro etc. This will save the transparancey info for java to use automatically.
I know at least version 89a gifs are supported. Probably more others are too.
snowmoon
snowmoon
Overkill... Both AWT Gif loading and Java2d fully support transparent Gif''s. There is much informaition about doning this.

Now you project doe shave advantages, as you could apply this to formats that don''t have transparecy ( jpg ).

bobbin
bobbin
quote:
Original post by Anonymous Poster

then how come when I load an image it isn''t transparent? Ok so I have an Image variable named picture, and a gif called picture.gif. How exactly would I load it without losing the alpha information?



FOO RTFM, don''t you people buy books?
Check out http://web2.java.sun.com/docs/books/tutorial/
or buy "Java in a nutShell"...
Do you need people to feed you too??

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.