DOCUMENT:Q193589 02-OCT-1998 [vbwin] TITLE :HOWTO: Create Transparent Images From Bitmaps PRODUCT :Microsoft Visual Basic for Windows PROD/VER:WINDOWS:5.0,6.0 OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0 --------------------------------------------------------------------- SUMMARY ======= In previous versions of Visual Basic, creating transparent bitmaps required extensive use of the Windows API. The problem was that Visual Basic controls could not use graphic file types (such as GIF) that support transparency. Visual Basic for Windows versions 5.0 and 6.0 controls can use files in a much wider range of formats than previous versions. MORE INFORMATION ================ While it is still possible to handle transparent bitmaps programmatically, this article presents a solution that requires no code. This approach requires the use of a graphics editor such as the Microsoft Photo Editor that ships with Office 97, but any graphic editor that can set a transparent color will suffice. Steps To Create a Transparent Image From a Bitmap ------------------------------------------------- 1. Open the bitmap in Microsoft Photo Editor. 2. Click the "Select Transparent Color" button on the toolbar. 3. Click on the bitmap background to select the color (Photo Editor selects by color - not area). It should "hatch" the selected color. Click OK on the "Change Color to Transparent" dialog that appears. 4. Use File...SaveAs to save the bitmap as a .GIF image. 5. Specify the .GIF file as the Image property in any control that supports this file type. REFERENCES ========== For information on creating bitmaps via code, with or without transparency, please see the following article in the Microsoft Knowledge Base: ARTICLE-ID: Q187568 TITLE : HOWTO: Create Your Own Bitmap Object Class Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbVBp600 kbBitmap ====================================================================== Version : WINDOWS:5.0,6.0 Platform : WINDOWS Issue type : kbhowto ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.