System.Drawing.ToolboxBitmap and gif file requirements

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
N

Nathan Sokalski

I have finally managed to get the System.Drawing.ToolboxBitmap attribute to
work, but it is only working with some of the *.gif files I have created.
All of the *.gif files I tried it with are 16x16 and were created using
Adobe Photoshop. However, I cannot figure out what the difference between
the *.gif files is. Are there any specific requirements and/or restrictions
that must be met when creating a *.gif for use with the
System.Drawing.ToolboxBitmap attribute? Or, am I supposed to be using a
different file format for the image (I want to be able to have transparency
in the image)? Any help would be appreciated. Thanks.
 
Please do not cross-post inappropriately. By definition, it's practically
never correct to cross-post between the C# and VB.NET newsgroups, and in
this case the question doesn't appear to have anything to do at all with
either language anyway.

In the correct newsgroup, you should also elaborate on your question.
What have you tried that doesn't work? Why did you expect it to work?
What _exactly_ doesn't work? Does the image not show up at all? Does it
show up, but without transparency? Something else?

As the docs say, the image _must_ be 16x16. And if you want transparency,
you have to make sure that you're using a drawing program that supports
transparency. Not all do, and even those that do, you have to make sure
you're setting the transparent color in the GIF correctly.

There may be other requirements I'm not aware of, but you should be clear
about which requirements you already know about and are complying with.
The docs clearly show using a BMP file, but of course that won't support
transparency. You might also try PNG, which does support transparency and
in a less "hacky" way than GIF, as well as 24-bit color. Though, if GIF
works for you, you might as well stick with that I would think.

I've copied your original message below, in case you want to elaborate
conveniently by replying to this message.

Pete
 
Back
Top