home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / win_lrn / graphics / bit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-11  |  1.2 KB  |  44 lines

  1. /*
  2.  *
  3.  * Functions: hDC CreateDC(lpString, lpString, lpString, lpString)
  4.  *          hDC CreateCompatibleDC(hDC)
  5.  *      HBITMAP LoadBitmap(hInstance, lpString)
  6.  *      hObject SelectObject(hDC, hObject)
  7.  *         BOOL StretchBlt(hDC,X,Y,nWidth,nHeight,hDC,
  8.  *                 XSrc,YSrc,XSrcWidth,YSrcHeight,dwROP)
  9.  *         BOOL BitBlt(hDC,X,Y,nWidth,nHeight,hDC,XSrc,YSrc,dwROP)
  10.  *         BOOL DeleteDC(hDC)
  11.  *         BOOL DeleteObject(hObject)
  12.  */
  13. #include "windows.h"
  14. #include "stdio.h"
  15.  
  16. int    PASCAL WinMain( hInstance, hPrevInstance, lpszCmdLine, cmdShow )
  17. HANDLE hInstance, hPrevInstance;
  18. LPSTR  lpszCmdLine;
  19. int    cmdShow;
  20. {
  21.   HDC     oneDC, screenDC;
  22.   HBITMAP hWorld;
  23.   int    Index;
  24.   char    LoadBitmapString [40];
  25.  
  26.   screenDC = CreateDC("DISPLAY", NULL, NULL, NULL);
  27.   oneDC = CreateCompatibleDC(screenDC);
  28.   Index = 1;
  29.   sprintf (LoadBitmapString, "WORLD%i", Index);
  30.   hWorld = LoadBitmap(hInstance, LoadBitmapString);
  31.   SelectObject(oneDC, hWorld);
  32.   StretchBlt(screenDC, 250, 140, 99, 99, oneDC, 0, 0, 99, 99, SRCCOPY);
  33. /*
  34.     StretchBlt(screenDC, 150, 75, 51, 100, oneDC, 0, 0, 51, 31, SRCCOPY);
  35.     BitBlt(screenDC, 75, 75, 52, 32, oneDC, 0, 0, SRCCOPY);
  36. */
  37.   DeleteDC(oneDC);
  38.   DeleteDC(screenDC);
  39.   DeleteObject(hWorld);
  40.   return 0;
  41. }
  42.  
  43.  
  44.