Hello all,
I need to display icons on Windows Forms. The icons are kept in an unmanaged resource-only dll.
This is what I have done so far:
1. using InterOp, call LoadLibrary and LoadIcon API's
2. Bitmap bitmap = Bitmap.FromHIcon ( <returned handle from LoadIcon> )
3. bitmap.MakeTransparent ( <All kinds of parameters tried here> )
4. Image image = Image.FromHBitmap(bitmap.GetHBitmap())
5. using InterOp, call DestroyIcon and FreeLibrary API's
Problem with this code is, transparency is lost. What should be transparent is displayed blue (I think it is RGB 0, 0, 211).
Who knows how to get the transparency back?
Thanks in advance,
Marcel
I need to display icons on Windows Forms. The icons are kept in an unmanaged resource-only dll.
This is what I have done so far:
1. using InterOp, call LoadLibrary and LoadIcon API's
2. Bitmap bitmap = Bitmap.FromHIcon ( <returned handle from LoadIcon> )
3. bitmap.MakeTransparent ( <All kinds of parameters tried here> )
4. Image image = Image.FromHBitmap(bitmap.GetHBitmap())
5. using InterOp, call DestroyIcon and FreeLibrary API's
Problem with this code is, transparency is lost. What should be transparent is displayed blue (I think it is RGB 0, 0, 211).
Who knows how to get the transparency back?
Thanks in advance,
Marcel