Masking .BMP Files in FoxPro for Windows

Last reviewed: April 29, 1996
Article ID: Q94344
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a

SUMMARY

This article describes how to mask a bitmap picture.

MORE INFORMATION

When FoxPro for Windows loads a .BMP file as a screen picture, picture button, or check box, it checks the directory for a corresponding .MSK file to use as a mask for the .BMP file. FoxPro displays the portions of the .BMP file that correspond to black areas of the .MSK file and makes transparent the portions of the .BMP file that correspond to white areas of the .MSK file. If FoxPro does not find an appropriate .MSK file, FoxPro makes all white areas of the .BMP file transparent.

The image in the .BMP file and the image in the .MSK file must have the same dimensions.

To create a FoxPro for Windows .MSK file for a .BMP file:

  1. Open the .BMP file in Microsoft Windows Paintbrush or another bitmap-editing utility.

  2. From the File menu, choose Save As, and then change the file type to Monochrome Bitmap. Replace .BMP with .MSK for the filename extension. Choose OK to save the new .MSK file.

    NOTE: In the Windows 95 Paint program, you can't save your file with a file name extension other than .BMP. To work around this, save the file, then use Explorer or My Computer to change the file extension. To view the extension in Explorer or My Computer, click View, and then options. Click the View tab, and then clear the Hide MS-DOS File Extensions for File Types That Are Registered check box

  3. Fill in black the portions of the .MSK file that correspond to the part of the .BMP file that should appear in FoxPro for Windows. Make the remainder of the .MSK file white.

  4. Save the .MSK file in the same directory as the .BMP file.

REFERENCES

FoxPro for Windows "User's Guide", version 2.5, page U11-51


Additional reference words: VFoxWin 3.00 FoxWin 2.50 2.50a color
KBCategory: kbprg
KBSubcategory: FxprgGeneral


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.

Last reviewed: April 29, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.