Techniques

Code tips
32-bit Bitmap
If you're creating toolbars and menus for Visual Studio, the only way to get a crisp icon for the item is to use a 32-bit bitmap, which is a 24-bit bitmap plus an 8-bit alpha channel. Unlike lower bit levels, 32-bit bitmaps support transparency which prevent your icons from looking like a box. Worse still, I discovered that using 24-bit bitmaps creates artifacts in the form of little black dots when rendered. Unfortunately, unless you have a license to Photoshop, you may discover that none of your...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, May 21, 2009 10:46 AM | Feedback (4)

String to Stream
Sometimes a string isn't enough, you need a stream. Unfortunately, there isn't a direct method to stick a string into a stream. But we are saved! MemoryStream will take bytes... here's how to convert your string into a series of bytes so you can get that all important StringStream. No, I'm not going to make a StringStream class though you certainly can fulfill your masochistic class explosion desires. String request = "I can has cheezburger?"; MemoryStream stream = new MemoryStream(Encoding.Unico...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Posted On Thursday, August 07, 2008 5:37 PM | Feedback (0)