Article View: comp.os.ms-windows.programmer.misc
Article #2439Creating Metafiles
From: Eilef Hellem
Date: Thu, 28 Jan 1993 07:37
Date: Thu, 28 Jan 1993 07:37
57 lines
2426 bytes
2426 bytes
I'm trying to create a metafile from my simple application
but i have a quite serious problem. When i use the following
code :
brush=CreateSolidBrush(....);
pen=CreateSolidPen(....);
hcdMeta=CreateMetaFile("metafile.wmf");
SetMapMode(hdcMeta,MM_ANISOTROPIC); // 1
SetWindowOrg(hdcMeta,...); // 2
SetWindowExt(hdcMeta,...); // 3
SelectObject(hdcMeta,brush); // 4
SelectObject(hdcMeta,pen); // 5
Rectangle(hcdMeta,...); // 6
.
.
// GDI-calls supported by metafiles
.
.
DeleteMetaFile(CloseMetaFile(hdcMeta));
DeleteObject(brush);
DeleteObject(pen);
.
.
...nothing happens in my application when i try to draw it
nor in the sample 'wmfdcode' that follows Microsoft's SDK 3.1.
It seems however that if i remove 1 ( // 1 ), everything works ok,
though my intension of it all is also removed. I want to scale
the darn thing, without having to set the mapping mode in
my application.
Well i looked in microsoft's guidelines to create a metafile
and it says that you should set a mapping mode in any metafile
so that they are device independent....
Howcome my code doesn't work.
Can anybody help me please!!!
thanx in advance
Eilef
+-----------------+-----------------------+--------------------------+
| | E-Mail: | |
| Eilef Hellem | | /|/ / / / / _ _/ / |
| MRIH | eh@mrih.no | _/ _/ /__/ /_ _/ _/ |
| AAlesund | | |
| Norway | or | |
| | | |
| | eilef.hellem@mrih.no | Information at your |
| | | fingertips..,I'm in! |
+-----------------+-----------------------+--------------------------+
Technical Details
Message-ID:
<1993Jan28.073717.4694@ugle.unit.no>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!yale.edu!ira.uka.de!gmd.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!ehShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!spool.mu.edu!yale.edu!ira.uka.de!gmd.de!Germany.EU.net!mcsun!sunic!ugle.unit.no!eh From: eh@mrih.no (Eilef Hellem) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Creating Metafiles Message-ID: <1993Jan28.073717.4694@ugle.unit.no> Date: 28 Jan 93 07:37:17 GMT Sender: news@ugle.unit.no (NetNews Administrator) Organization: More og Romsdal Ingeniorhogskole Lines: 57 X-Newsreader: TIN [version 1.1 PL8]