home *** CD-ROM | disk | FTP | other *** search
- // Strbmp.h : Header file for VB string to bitmap conversion DLL.
- //
- // Freeware -- Version 1.1 09/20/93
- //
- // Written by Jorge Monasterio (CIS 72147, 2674)
- //
- //
-
-
- // Types
- // The following types are used in the DLL.
- // HLSTR -- Used to pass/return VB type strings.
- // LPSTR -- Used to point to zero-terminated strings (internal).
- // LONG -- Used to pass/return VB type integers.
- // STRINGBMP -- A zero-terminated string containing header info + bmp data.
-
- // DLL(Type) defines function return type as exported DLL function.
- #define DLL(t) extern "C" t FAR PASCAL _export
-
- // Constants
- const WORD MAX_VB_STRING_LENGTH = 65000L;
-
- const ILLEGAL_FUNCTION_CALL = 20005; // When string sizes don't match.
- const INVALID_PICTURE = 20481; // When string doesn't contain bitmap.
- const OUT_OF_STRING_SPACE = 20014; // When picture too big for string.
-
- // Header information stored in VB string for any converted BMP.
- const StringBmpIdentifier = 0x5342; // = "SB"
- struct SB {
- WORD identifier; // Must be 'SB' = 0x5342
- WORD width; // Width in pixels of the image.
- WORD height; // Height in pixels of the image.
- WORD widthbytes; // Width in bytes of the image.
- };
-
- // In the VB string, store the above header then the data.
- union STRINGBMP
- { struct SB FAR *stringbmp; // Header.
- LPSTR vbstring; // Data.
- };
-
- // Function prototypes:
- DLL(HLSTR) BMPToString( HDC hdc, HBITMAP hImage);
- DLL(LONG) StringToBMP( LPSTR string, HDC hdcSrc, HBITMAP hbmpSrc);
- DLL(LONG) StringBMP_Compare( LPSTR A, LPSTR B);
- DLL(HLSTR) StringBMP_AND( LPSTR A, LPSTR B);
- DLL(HLSTR) StringBMP_OR( LPSTR A, LPSTR B);
- DLL(HLSTR) StringBMP_INVERT( LPSTR A);
- DLL(HLSTR) StringBMP_FILL( LPSTR A);
- DLL(LONG) BMP_GetSize( HBITMAP hImage);
-
- // Local only -- should not be called from VB.
- DLL(void) ReturnVBError( WORD err, LPSTR msg);
- DLL(LONG) StringBMP_SetDimensions( LPSTR A, int w, int h, int wb);
- DLL(WORD) StringBMP_GetWidth( LPSTR A);
- DLL(WORD) StringBMP_GetWidthBytes( LPSTR A);
- DLL(WORD) StringBMP_GetHeight( LPSTR A);
- DLL(WORD) StringBMP_ValidateParameters( LPSTR A, LPSTR B);
- DLL(WORD) StringBMP_VerifyIdentifier( LPSTR A);
-