Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 717
  • Last Modified:

wmf to dxf

Anybody out there who knows how to convert a wmf to dxf file format using VB?
0
imby
Asked:
imby
1 Solution
 
soedingCommented:
What is the dxf file format?
0
 
Answers2000Commented:
I thought I answered this in General Graphics (for 30 points - thanks imby).  Here's the answer again (can I have 200 <g>!) with an addition for soeding

dxf = the data exchange format used to exchange data between CAD packages (vector graphics type of thin).  It's kind of ASCII records, although there's now a binary flavour.  Also a lot of graphics drawing packages now support it as in import or export format.

Anyway here's the repeat answer:


You have to write a substantial amount of code to do this.  Basically you'd have to step through the input file, play into some kind of memory structure and write it out bit by bit.  This will take a lot of time to write as both formats have a lot of complicated variation.

You can read up on WMF in the SDK documentation.  Be aware there are enhanced and win 3.1 formats.  Additionally there is a Xerox variant used in DTP which precedes the win 3.1 format with some additional crap.

You can read up on DXF in Chapter 19 of Graphics File Formats by Kay & Levine, Windcrest/McGraw-Hill 1995, ISBN 0-07-034025-0.  (it also has some on WMF too).

If you decide to write this code, I would suggest you don't do it in  VB.  WMF is a low level format (lots of bit manipulation).  It would be a good task for C or C++.  Stick the C code into DLL, ActiveX or OCX control, and then call it from VB.

However if you simply want to translate, use a trick: find a program (e.g. Halo, I think) which has a command line translator, and kick it off from VB.

Lead Tools also have an OCX which does graphics display and is supposed to support WMF & DXF.  I haven't tried it, but this may also be sufficient (you won't get source, but you can call it from your VB program)

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now