Solved

wmf to dxf

Posted on 1998-08-12
2
676 Views
Last Modified: 2011-10-03
Anybody out there who knows how to convert a wmf to dxf file format using VB?
0
Comment
Question by:imby
2 Comments
 
LVL 1

Expert Comment

by:soeding
ID: 1468684
What is the dxf file format?
0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 200 total points
ID: 1468685
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now