home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / win_lrn / graphics / sbitdim.c < prev    next >
C/C++ Source or Header  |  1988-08-10  |  1KB  |  40 lines

  1. /*
  2.  *  SetBitmapDimension
  3.  *  sbitdim.c,
  4.  *  
  5.  *  This program demonstrates the use of the function SetBitmapDimension.
  6.  *  This funtion assigns a width and height to a bitmap in 0.1 millimeters
  7.  *  units.  These values are not used internally by GDI.
  8.  *   
  9.  */
  10.  
  11. #include "windows.h"
  12.  
  13. int PASCAL WinMain( hInstance, hPrevInstance, lpszCmdLine, cmdShow )
  14. HANDLE hInstance, hPrevInstance;
  15. LPSTR  lpszCmdLine;
  16. int    cmdShow;
  17. {
  18.   HBITMAP hBitmap;
  19.   DWORD ptOldDimensions;
  20.   DWORD ptDimensions;
  21.  
  22.   hBitmap = LoadBitmap ( hInstance, (LPSTR)"SMILE" );
  23.  
  24.   MessageBox (NULL, (LPSTR)"Setting new dimensions ",
  25.              (LPSTR)"SetBitmapDimension", MB_OK);
  26.  
  27.   ptOldDimensions = SetBitmapDimension ( hBitmap, 15, 15 );
  28.  
  29.   ptDimensions = GetBitmapDimension ( hBitmap );
  30.  
  31.   if ( (HIWORD(ptDimensions) != 0) || (LOWORD(ptDimensions) != 0) )
  32.      MessageBox (NULL, (LPSTR)"New dimensions set.",
  33.                 (LPSTR)"SetBitmapDimension", MB_OK);
  34.   else
  35.      MessageBox (NULL, (LPSTR)"New dimensions not set",
  36.                 (LPSTR)"SetBitmapDimension", MB_OK);
  37.  
  38.   return 0;
  39. }
  40.