home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5487 < prev    next >
Encoding:
Internet Message Format  |  1993-01-29  |  2.3 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!yale.edu!ira.uka.de!gmd.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!eh
  2. From: eh@mrih.no (Eilef Hellem)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Creating Metafiles
  5. Message-ID: <1993Jan28.073717.4694@ugle.unit.no>
  6. Date: 28 Jan 93 07:37:17 GMT
  7. Sender: news@ugle.unit.no (NetNews Administrator)
  8. Organization: More og Romsdal Ingeniorhogskole
  9. Lines: 57
  10. X-Newsreader: TIN [version 1.1 PL8]
  11.  
  12.  
  13.     I'm trying to create a metafile from my simple application
  14.     but i have a quite serious problem. When i use the following 
  15.     code :
  16.  
  17.     brush=CreateSolidBrush(....);
  18.     pen=CreateSolidPen(....);
  19.     hcdMeta=CreateMetaFile("metafile.wmf");
  20.         SetMapMode(hdcMeta,MM_ANISOTROPIC);      // 1
  21.         SetWindowOrg(hdcMeta,...);        // 2
  22.         SetWindowExt(hdcMeta,...);        // 3
  23.         SelectObject(hdcMeta,brush);        // 4
  24.         SelectObject(hdcMeta,pen);        // 5
  25.         Rectangle(hcdMeta,...);            // 6
  26.             .
  27.             .
  28.         // GDI-calls supported by metafiles
  29.             .
  30.             .
  31.     DeleteMetaFile(CloseMetaFile(hdcMeta));
  32.     DeleteObject(brush);
  33.     DeleteObject(pen);
  34.         .
  35.         .
  36.  
  37.     ...nothing happens in my application when i try to draw it
  38.     nor in the sample 'wmfdcode' that follows Microsoft's SDK 3.1.    
  39.     It seems however that if i remove 1 ( // 1 ), everything works ok,
  40.     though my intension of it all is also removed. I want to scale
  41.     the darn thing, without having to set the mapping mode in
  42.     my application.
  43.     
  44.     Well i looked in microsoft's guidelines to create a metafile
  45.     and it says that you should set a mapping mode in any metafile
  46.     so that they are device independent....
  47.     Howcome my code doesn't work.
  48.     Can anybody help me please!!!
  49.  
  50. thanx in advance 
  51.  
  52. Eilef    
  53.  
  54.  +-----------------+-----------------------+--------------------------+
  55.  |                 | E-Mail:               |                          |
  56.  |  Eilef Hellem   |                       |   /|/ /  /  / / _  _/  / |
  57.  |  MRIH           |  eh@mrih.no           | _/  _/  /__/ /_  _/  _/  |
  58.  |  AAlesund       |                       |                          |
  59.  |  Norway         |     or                |                          |
  60.  |                 |                       |                          |
  61.  |                 |  eilef.hellem@mrih.no | Information at your      |
  62.  |                 |                       | fingertips..,I'm in!     |
  63.  +-----------------+-----------------------+--------------------------+
  64.  
  65.  
  66.  
  67.  
  68.     
  69.