HighTechTalks DotNet Forums  

Get System Icon display on Picture Box

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Get System Icon display on Picture Box in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Andrew
 
Posts: n/a

Default Get System Icon display on Picture Box - 07-02-2003 , 02:39 AM






I want to get the system icon and display it on picture box. But the result
of the picture which show on the picture box the alpha channel to be black
in color.

How can I get a right system icon to display on the picture box?
s
P.S. My OS is WinXP, so the system icon have alpha channel.

Code:
System.Drawing.Bitmap bitmap =
System.Drawing.Bitmap.FromHicon(SystemIcons.Questi on.Handle);
this.pb.Image = bitmap;



Reply With Quote
  #2  
Old   
Michael Zino
 
Posts: n/a

Default Re: Get System Icon display on Picture Box - 07-02-2003 , 08:32 AM






Dear Andrew,
Try to add the following line before assigning the bitmap instance to the
picture box's Image property:

bitmap.MakeTransparent(Colors.FromArgb(0,0,0));

However, you will see that you'll get better result but not the perfect.
If you really want to get better results, I suggest you to save the icons
(hand-coding) or find their resources--in order to adjust their desired
transparency color.

Regards,
Michael Zino


"Andrew" <andrew (AT) flex-logic (DOT) com> wrote

Quote:
I want to get the system icon and display it on picture box. But the
result
of the picture which show on the picture box the alpha channel to be black
in color.

How can I get a right system icon to display on the picture box?
s
P.S. My OS is WinXP, so the system icon have alpha channel.

Code:
System.Drawing.Bitmap bitmap =
System.Drawing.Bitmap.FromHicon(SystemIcons.Questi on.Handle);
this.pb.Image = bitmap;





Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.