home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / progwin / chap13 / mfcreate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-12  |  841 b   |  29 lines

  1. /*-----------------------------------------
  2.    MFCREATE.C -- Metafile Creation Program
  3.                  (c) Charles Petzold, 1990
  4.   -----------------------------------------*/
  5.  
  6. #include <windows.h>
  7.  
  8. int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
  9.                     LPSTR lpszCmdLine, int nCmdShow)
  10.      {
  11.      HBRUSH hBrush  = CreateSolidBrush (RGB (0, 0, 255)) ;
  12.      HDC    hdcMeta = CreateMetaFile ("MYLOGO.WMF") ;
  13.  
  14.      Rectangle (hdcMeta, 0, 0, 100, 100) ;
  15.      MoveTo (hdcMeta, 0, 0) ;
  16.      LineTo (hdcMeta, 100, 100) ;
  17.      MoveTo (hdcMeta, 0, 100) ;
  18.      LineTo (hdcMeta, 100, 0) ;
  19.      SelectObject (hdcMeta, hBrush) ;
  20.      Ellipse (hdcMeta, 20, 20, 80, 80) ;
  21.  
  22.      DeleteMetaFile (CloseMetaFile (hdcMeta)) ;
  23.      DeleteObject (hBrush) ;
  24.  
  25.      MessageBeep (0) ;
  26.  
  27.      return FALSE ;
  28.      }
  29.