🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #264

Re: Transparent images

#264
From: Tor Iver Wilhelmsen (TeamB)
Date: Mon, 22 Mar 2004 07:13
13 lines
1368 bytes
"loquak" <liam_parc@hotmail.com> writes:

> How on earth is it possible to draw transparent images in Java? I have an
> Image object, load the image from a file and draw it on a Graphics object.
> The question is: I want all black pixels to be transparent when drawn on
> another image.

The easiest way is if the Image is loaded from a file format that
supports transparency natively - then it should "work" as long as
black is the transparent color.

Other than that, you can try to get the Image's ColorModel, look for
black and set its alpha component.
Technical Details
Message-ID: <ufzc15p6z.fsf@ergo.no>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail
References: <405dc828$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,589da8e0e1287afb
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2004-03-21 23:35:35 PST
Sender: towi@SDSA4902
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: Transparent images
References: <405dc828$1@newsgroups.borland.com>
From: tor.wilhelmsen@ergo.no (Tor Iver Wilhelmsen (TeamB))
Date: 22 Mar 2004 08:13:56 +0100
Message-ID: <ufzc15p6z.fsf@ergo.no>
Lines: 13
X-Newsreader: Gnus v5.7/Emacs 20.7
NNTP-Posting-Host: 139.105.130.109
X-Trace: newsgroups.borland.com 1079939634 139.105.130.109 (21 Mar 2004 23:13:54 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed.iinet.net.au!newsfeed.iinet.net.au!PeerFeed.KWeb.on.ca!news.kweb.on.ca!newsgroups.borland.com!not-for-mail