Solved

wmf to dxf

Posted on 1998-08-12
2
671 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 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

13 Experts available now in Live!

Get 1:1 Help Now