Click here to Skip to main content
15,915,513 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Subclassing? Pin
Stan Shannon13-Nov-02 7:08
Stan Shannon13-Nov-02 7:08 
QuestionHow do I catch ListView's scrolling? Pin
8-Nov-02 2:01
suss8-Nov-02 2:01 
AnswerRe: How do I catch ListView's scrolling? Pin
Stan Shannon11-Nov-02 2:24
Stan Shannon11-Nov-02 2:24 
GeneralRe: How do I catch ListView's scrolling Pin
ikinari11-Nov-02 13:46
ikinari11-Nov-02 13:46 
GeneralWeb Service Session State Pin
Code for Food7-Nov-02 12:15
Code for Food7-Nov-02 12:15 
QuestionHow to set form to maximum form... Pin
Munti7-Nov-02 11:43
Munti7-Nov-02 11:43 
AnswerRe: How to set form to maximum form... Pin
Paul Watson7-Nov-02 11:53
sitebuilderPaul Watson7-Nov-02 11:53 
GeneralRe: How to set form to maximum form... Pin
Munti7-Nov-02 12:14
Munti7-Nov-02 12:14 
GeneralProblem with .NET and W2K Pin
Marc Clifton7-Nov-02 11:00
mvaMarc Clifton7-Nov-02 11:00 
GeneralRe: Problem with .NET and W2K Pin
Sijin12-Nov-02 1:59
Sijin12-Nov-02 1:59 
GeneralSerializing an Exception object Pin
solidstore7-Nov-02 7:11
solidstore7-Nov-02 7:11 
GeneralGDI+ vs DirectX Pin
SimonS6-Nov-02 22:19
SimonS6-Nov-02 22:19 
GeneralRe: GDI+ vs DirectX Pin
Christian Graus6-Nov-02 22:23
protectorChristian Graus6-Nov-02 22:23 
GeneralInstallation tool Pin
Patrick Lassalle6-Nov-02 10:25
Patrick Lassalle6-Nov-02 10:25 
GeneralRe: Installation tool Pin
Heath Stewart6-Nov-02 19:43
protectorHeath Stewart6-Nov-02 19:43 
GeneralRe: Installation tool Pin
Patrick Lassalle7-Nov-02 6:13
Patrick Lassalle7-Nov-02 6:13 
GeneralRe: Installation tool Pin
Daniel Turini7-Nov-02 7:20
Daniel Turini7-Nov-02 7:20 
GeneralRe: Installation tool Pin
Heath Stewart7-Nov-02 9:51
protectorHeath Stewart7-Nov-02 9:51 
GeneralRe: Installation tool Pin
Patrick Lassalle7-Nov-02 23:20
Patrick Lassalle7-Nov-02 23:20 
GeneralConverting an Icon to Image...with Alpha Blending Pin
Heath Stewart5-Nov-02 13:34
protectorHeath Stewart5-Nov-02 13:34 
Converting an Icon to an Image is easy: Image img = ico.ToBitmap() - except when you need alpha blending. After digging through the IL for Icon.ToBitmap(), the concept is simple and helped me find some .NET docs that discussed off-screen rending with alpha channels. The following code should work:
Image img = new Bitmap(16, 16, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(img);
g.CompositingMode = CompositingMode.SourceCopy;
g.DrawIcon(Icon.FromHandle(hIcon), 0, 0);
g.Dispose();

If I display img in a PictureBox or draw it in a form's graphics object, the alpha channel is all black. If, instead, I draw the icon directly on the form, the alpha channel is blended accordingly.

I've also tried filling the graphics object for the Bitmap img with SystemColors.Control (default for Form, etc.) and then drawing the icon after setting the compositing mode, but that doesn't work either.

Has anyone successfully done this? I'm trying to make a wrapper component for SHGetFileInfo which works pretty well except for the whole alpha blending problem described above. TIA

"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
GeneralRe: Converting an Icon to Image...with Alpha Blending Pin
Heath Stewart6-Nov-02 8:29
protectorHeath Stewart6-Nov-02 8:29 
GeneralUPDATE Statements Pin
Derek Lakin4-Nov-02 22:17
Derek Lakin4-Nov-02 22:17 
GeneralC# vs VC++ Pin
Stefan Bolder2-Nov-02 22:41
sussStefan Bolder2-Nov-02 22:41 
GeneralRe: C# vs VC++ Pin
ian mariano3-Nov-02 7:56
ian mariano3-Nov-02 7:56 
GeneralRe: C# vs VC++ Pin
Kevin McFarlane4-Nov-02 3:48
Kevin McFarlane4-Nov-02 3:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.