Home All Groups Group Topic Archive Search About

Transparent Color in an Icon

Author
1 Jul 2005 11:35 PM
Dennis
How can I find the transparent color in an Icon and convert it into a Color
type in VB.Net 2003?

I want to convert it into a bitmap with the same color transparent.  I know
that I can convert it to a bitmap then read the color of the pixel at 0,0
then make that color transparent in the bitmap but this doesn't work on icons
that have other than the transparent color in the 0,0 pixel position.

--
Dennis in Houston

Author
3 Jul 2005 7:15 AM
Cor Ligthert
Dennis,

Bob Powell is the painting guy, did you see his pages already

http://www.bobpowell.net/

I hope this helps something

Cor
Author
3 Jul 2005 10:33 AM
Dennis
Thanks but he doesn't cover this topic.
--
Dennis in Houston


Show quoteHide quote
"Cor Ligthert" wrote:

> Dennis,
>
> Bob Powell is the painting guy, did you see his pages already
>
> http://www.bobpowell.net/
>
> I hope this helps something
>
> Cor
>
>
>
Author
3 Jul 2005 10:51 AM
Cor Ligthert
Dennis,

I see now that your question is not often answered in this newsgroup.

However maybe you can search this newsgroup and first look at this thread,

http://groups-beta.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/f4b3cd7f62c5f30a/7126cb411e73a2c8#7126cb411e73a2c8


:-)

Cor
Author
3 Jul 2005 10:56 AM
Supra
:-) lovely site! it isn't?

Cor Ligthert wrote:

Show quoteHide quote
>Dennis,
>
>Bob Powell is the painting guy, did you see his pages already
>
>http://www.bobpowell.net/
>
>I hope this helps something
>
>Cor
>
>

>
Author
3 Jul 2005 11:39 AM
Herfried K. Wagner [MVP]
"Dennis" <Den***@discussions.microsoft.com> schrieb:
> How can I find the transparent color in an Icon and convert it into a
> Color
> type in VB.Net 2003?
>
> I want to convert it into a bitmap with the same color transparent.  I
> know
> that I can convert it to a bitmap then read the color of the pixel at 0,0
> then make that color transparent in the bitmap but this doesn't work on
> icons
> that have other than the transparent color in the 0,0 pixel position.

Did you already try 'ToBitmap'?  This method will preserve transparency:

\\\
Dim i As Icon = ...
Dim b As Bitmap = i.ToBitmap()
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
3 Jul 2005 12:34 PM
Dennis
Haven't tried that yet but will do so.  When it's converted to the bitmap, is
there any way to find the transparency color from the bitmap?
--
Dennis in Houston


Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "Dennis" <Den***@discussions.microsoft.com> schrieb:
> > How can I find the transparent color in an Icon and convert it into a
> > Color
> > type in VB.Net 2003?
> >
> > I want to convert it into a bitmap with the same color transparent.  I
> > know
> > that I can convert it to a bitmap then read the color of the pixel at 0,0
> > then make that color transparent in the bitmap but this doesn't work on
> > icons
> > that have other than the transparent color in the 0,0 pixel position.
>
> Did you already try 'ToBitmap'?  This method will preserve transparency:
>
> \\\
> Dim i As Icon = ...
> Dim b As Bitmap = i.ToBitmap()
> ///
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>
Author
3 Jul 2005 6:41 PM
bastawhiz
Well, bitmaps really can't have transparent colors... I would
personally use PNGs. And even then, Microsoft is notorious for making
it almost impossible to use ARGB in .Net.
Author
3 Jul 2005 7:20 PM
Dennis
So how does bitmap.MakeTransparent(color.red) work.  Doesn't the bit map
display routines mask all pixel colors with Red backgroud mask that is Xor'd
or something like that to cancel out displaying all red colors in the bitmap.
I'm looking to find what that color is...there must be someway since the
bitmap certainly can have transparent areas.
--
Dennis in Houston


Show quoteHide quote
"bastaw***@gmail.com" wrote:

> Well, bitmaps really can't have transparent colors... I would
> personally use PNGs. And even then, Microsoft is notorious for making
> it almost impossible to use ARGB in .Net.
>
>