home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code2 / str2bmp / str2bmp.h < prev    next >
C/C++ Source or Header  |  1993-06-13  |  2KB  |  56 lines

  1. // Code for converting BMPs to strings and strings to BMPs.
  2. //     (C) 1993, Balboa Technical Services.
  3. //
  4. //
  5. //
  6.  
  7.  
  8. // Type definitions ( compiler specific)
  9. #define DLL_LONG extern "C" DWORD FAR PASCAL _export
  10. #define DLL_INT extern "C" WORD FAR PASCAL _export
  11. typedef char far * STRINGPTR;
  12. typedef WORD PIXELS;
  13.  
  14. // Constants
  15. const BLACK = 0x00;   // Logic 0.  (Foreground color)
  16. const WHITE = -1;     // Logic 1.  (Background color)
  17.  
  18.                                              // String Bmp header structure. This information is stored at the beginning
  19. //    of string to store info on size of bitmap stored in the string.
  20. const StringBmpIdentifier =  0x5342;  // = "SB"
  21. struct SB {
  22.    WORD identifier;  // Must be 'SB' = 0x5342
  23.    WORD width;
  24.    WORD height;
  25.    WORD widthbytes;
  26.  };
  27.  
  28. union StringBmpType
  29.  { struct SB FAR *stringbmp;
  30.    STRINGPTR vbstring;
  31.  }; 
  32.  
  33. // Function prototypes:
  34. DLL_LONG Bmp_GetSize( HBITMAP hImage);
  35. DLL_LONG BmpToString( HDC hdc, HBITMAP hImage, LPSTR string);
  36. DLL_LONG StringToBmp( LPSTR string, HDC hdcSrc, HBITMAP hbmpSrc);
  37. DLL_LONG StringBmp_OR( STRINGPTR A, STRINGPTR B, STRINGPTR RESULT);
  38. DLL_LONG StringBmp_AND( STRINGPTR A, STRINGPTR B, STRINGPTR RESULT);
  39. DLL_LONG StringBmp_INVERT( STRINGPTR A, STRINGPTR RESULT);
  40. DLL_LONG StringBmp_COMPARE( STRINGPTR A, STRINGPTR B);
  41.  
  42.  
  43.  
  44. // Local functions for use INTERNALLY to the DLL ONLY!!!
  45. DLL_LONG StringBmp_ValidateStringBmp( STRINGPTR A);
  46. DLL_LONG StringBmp_CheckSameSize( STRINGPTR A, STRINGPTR B);
  47. DLL_INT StringBmp_SetDimensions( STRINGPTR A, int w, int h, int wb);
  48. DLL_INT StringBmp_GetWidthBytes( STRINGPTR A);
  49. DLL_INT StringBmp_GetWidth( STRINGPTR A);
  50. DLL_INT StringBmp_GetHeight( STRINGPTR A);
  51. DLL_INT StringBmp_GetIdentifier( STRINGPTR A);
  52. DLL_LONG Bmp_GetHeight( HBITMAP hImage);
  53. DLL_LONG Bmp_GetWidth( HBITMAP hImage);
  54.  
  55.  
  56.