I've confirmed an error with the serialization of icons in the resource
file of an application.
What is happening is that the entire imagestream of an imagelist is not
serialized, just each individual bitmap and the fact that its an icon is
lost during this serialization.
The workaround has been posted earlier by Jeff Jackson. It is to load the
icon file embedded in the resources directly. As in:
this.m_imageList.Images.Add(new
Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceSt
ream("MyApp.myicon.ico")));
this.m_imageList.ImageSize = new System.Drawing.Size(16, 16);
Let me know if you have a problem with this.
-Ben
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: "Pawel Achtel" <
[email protected]>
| Subject: Icons apear with black bacground instead of transparent
| Date: Sun, 28 Sep 2003 17:47:14 +1000
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: cwpp-p-203-54-241-100.prem.tmns.net.au 203.54.241.100
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:34612
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Icons used in image list in tree and list boxes appear with black
| backgrounds. This happens for application icons also. The icons work on
some
| Pocket PCs. They are standard 16x16, 16-colour icons. Editor used: VC
3003,
| but some were unmodified Windows icons.
| Does anyone else found this problem and possibly a fix?
|
| Pawel
|
www.24x7.com.au
|
|
|
|