Re: Bitmap to Icon
- From: Dennis <Dennis@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Apr 2005 06:19:02 -0700
What I'm doing is reading an .ico file then converting it to a bitmap which I
then resize. I make the background color transparent then convert it back to
an icon file. The resulting bitmap after resizing shows ok with the
background color black transparent but the resulting icon doesn't have the
background color black transparent.
"Ken Tucker [MVP]" wrote:
> Hi,
>
> Dim bm As New Bitmap(16, 16)
>
> Dim g As Graphics = Graphics.FromImage(bm)
>
> g.Clear(Color.Black)
>
> g.DrawEllipse(Pens.White, 0, 0, 16, 16)
>
> bm.MakeTransparent(Color.Black)
>
> Dim ico As Drawing.Icon
>
> ico = Drawing.Icon.FromHandle(bm.GetHicon)
>
> Me.Icon = ico
>
>
>
> Ken
>
> ----------------------
>
> "Dennis" <Dennis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:AB3327BE-8C84-4350-9645-89013882D072@xxxxxxxxxxxxxxxx
> I have created a bitmap and set the transparency color to black;
>
> mybitmap.MakeTransparent(Color.Black)
> myicon = Icon.FromHandle(bm.GetHicon)
>
> This creates the icon ok but the background color black is not transparent.
>
> How do I create an Icon from this bitmap that has also the color black
> transparent?
>
>
> --
> Dennis in Houston
>
>
>
.
- References:
- Bitmap to Icon
- From: Dennis
- Re: Bitmap to Icon
- From: Ken Tucker [MVP]
- Bitmap to Icon
- Prev by Date: Re: How to determine folder .exe was run from?
- Next by Date: Re: Application Revents Logoff or shutdown
- Previous by thread: Re: Bitmap to Icon
- Next by thread: NUnit
- Index(es):
Relevant Pages
|