Setting transparent colour of image

  • Thread starter Thread starter Dylan Parry
  • Start date Start date
D

Dylan Parry

Hi,

I've got a byte array containing some image data, and I am writing it to
the web browser on the fly as a PNG file. The problem that I am having
is that I want to be able to change one of the colours within the file
to transparent.

I have tried searching Google for the answer, but I'm not sure exactly
what terms to look for, so nothing useful has come up! Can this actually
be done, and if so how would I go about it?

Thanks,
 
Dylan said:
Hi,

I've got a byte array containing some image data, and I am writing it to
the web browser on the fly as a PNG file. The problem that I am having
is that I want to be able to change one of the colours within the file
to transparent.

I have tried searching Google for the answer, but I'm not sure exactly
what terms to look for, so nothing useful has come up! Can this actually
be done, and if so how would I go about it?

Bearing in mind that quite a lot of browsers have trouble with PNG
transparency (see eg
<http://entropymine.com/jason/testbed/pngtrans/>)...

I would like to say I have definitively found an answer for you, but
this seems to be a bit of a minefield. This groogle search seems to
look promising though:

<http://tinyurl.com/kwka8>
 
Pondering the eternal question of "Hobnobs or Rich Tea?", Larry Lard
finally proclaimed:

Thanks. That got me on the right path, and I have managed to get
transparency working, although for some images it results in a Generic
GDI+ error, which is most unhelpful :( What I think I will do is leave
this particular hurdle for a while until the more important parts of my
system are finished!
 
Back
Top