Discussion:
Vector graphics in VB6
(too old to reply)
a***@spam.here-abo.fi
2009-07-04 13:03:31 UTC
Permalink
Another thing I should start to do in this vacation period is to build
up some basic vector graphics facilities for plotting points, lines,
curves (several very short lines), triangle fills, contours, 3D
surfaces, etc. in VB6.

Could someone tell me a good format which can easily be included in MS
Office as well as OpenOffice documents? For example, PostScript is a
good format, but cannot be introduced into Word or PowerPoint easily.
I have no idea about wmf and other possible formats. So far I have
plotted graphs on Forms or PictureBoxes and then SavePictured them
into bitmaps, which is not very efficient or clean. These do not
produce pictures in 300 dpi or higher resolution, which most journals
and magazines would like to have.

Is there some basic open source infrastructure in VB6 for simple vector
graphics?

With kind regards,

A. Bulsari
Richard Cole
2009-07-04 13:55:41 UTC
Permalink
This post might be inappropriate. Click to display it.
a***@spam.here-abo.fi
2009-07-04 14:20:53 UTC
Permalink
Post by Richard Cole
Post by a***@spam.here-abo.fi
Another thing I should start to do in this vacation period is to build
up some basic vector graphics facilities for plotting points, lines,
curves (several very short lines), triangle fills, contours, 3D
surfaces, etc. in VB6.
Could someone tell me a good format which can easily be included in MS
Office as well as OpenOffice documents? For example, PostScript is a
good format, but cannot be introduced into Word or PowerPoint easily.
I have no idea about wmf and other possible formats. So far I have
plotted graphs on Forms or PictureBoxes and then SavePictured them
into bitmaps, which is not very efficient or clean. These do not
produce pictures in 300 dpi or higher resolution, which most journals
and magazines would like to have.
Is there some basic open source infrastructure in VB6 for simple vector
graphics?
With kind regards,
A. Bulsari
The tools you need are built into VB6 (see the MSDN help)
For Line Drawing etc.
These (PSet, Line, Circle) are the ones I am using to show the plots
on windows. Then I have to store the plots as bitmaps which is not
very efficient because you can't easily resize them, and is not vector
graphics. My question was about VB code which would produce SVG, WMF,
EPS or other code containing the plots.

I also need to decide the graphics format (vector) to use in future.

With kind regards,

A. Bulsari
Post by Richard Cole
For Plotting
~~~~~~~
Use the MS Chart Control to produce charts.
Richard
Mike Williams
2009-07-04 20:11:03 UTC
Permalink
Post by a***@spam.here-abo.fi
Another thing I should start to do in this vacation period
is to build up some basic vector graphics facilities for
plotting points, lines, curve, triangle fills, contours, etc.
Could someone tell me a good format which can easily be
included in MS Office as well as OpenOffice documents?
For vector graphics metafiles would be a good bet, either standard
metafiles (.wmf) or enhanced metafiles (.emf). Of the two I would
think .emf would be best. Check out the CreateEnhMetaFile API function
which will allow your VB6 code to create an enhanced metafile in
memory or as a .emf file on disk so that you can draw stuff into it.
You can't use the native VB drawing functions of course but you can
use all of the equivalent API functions to draw into it (LineTo,
Ellipse, Polygon, PolyLine, Rectangle, FloodFill,
GradientFillTriangle, TextOut, DrawText, etc, etc). Once you have
saved your metafile (.emf) to disk you can then insert it into most
modern office applications (MS Word, Publisher, etc).

Mike
a***@spam.here-abo.fi
2009-07-05 11:11:31 UTC
Permalink
Post by Mike Williams
Post by a***@spam.here-abo.fi
Another thing I should start to do in this vacation period
is to build up some basic vector graphics facilities for
plotting points, lines, curve, triangle fills, contours, etc.
Could someone tell me a good format which can easily be
included in MS Office as well as OpenOffice documents?
For vector graphics metafiles would be a good bet, either standard
metafiles (.wmf) or enhanced metafiles (.emf). Of the two I would
think .emf would be best.
OK. Could you please also comment on the SVG format? Is it
incompatible with Word, PowerPoint, etc. or is there some other
trouble with it?
Post by Mike Williams
Check out the CreateEnhMetaFile API function
which will allow your VB6 code to create an enhanced metafile in
memory or as a .emf file on disk so that you can draw stuff into it.
You can't use the native VB drawing functions of course but you can
use all of the equivalent API functions to draw into it (LineTo,
Ellipse, Polygon, PolyLine, Rectangle, FloodFill,
GradientFillTriangle, TextOut, DrawText, etc, etc). Once you have
saved your metafile (.emf) to disk you can then insert it into most
modern office applications (MS Word, Publisher, etc).
Mike
I could check the API function, but since I will switch to Jabaco
slowly, I should minimise my dependence on Windows APIs. Once I know
the commands used in .wmf and .emf, it should not be difficult to
produce .emf files (particularly if they are text files like
PostScript, which I used to produce from Fortran programs) straight
from VB6 by Print commands.

I looked for Internet pages which tell me the basics of the .wmf
format and show simple examples, but Google throws millions of useless
URLs in the first several pages of search results. Perhaps I searched
with all the wrong keywords. Do you know of a good Internet site where
I can see simple examples of .wmf/.emf files, and a site where the
commands are listed?

Thanks for your reply.

With kind regards,

A. Bulsari
Mike Williams
2009-07-05 15:04:45 UTC
Permalink
[Mike Williams said] Check out the CreateEnhMetaFile API
function which will allow your VB6 code to create an
enhanced metafile
[A Bulsari said] OK. Could you please also comment on the
SVG format? Is it incompatible with Word, PowerPoint, etc.
or is there some other trouble with it?
I've never used svg images. As far as I can gather SVG is a XML based
relative newcomer and I think some browsers, including Windows
Explorer, don't support it by default unless you download a suitable
add-on. I certainly can't seem to see any of them when I search for
them. My IE browser appears to convert them to .png and sometimes they
appear as jpegs? I downloaded a 'playing card graphic' with an .svg
extension from the web just now and I can't get it into a MS Word
document. In fact I can't get anything to recognise it at all so I
cannot see what graphic it actually contains. I might be doing
something wrong though because as I said I've never used svg before.
I've just read somewhere that MS Word does not natively support them
and that to get them into a Word document you need to right click the
svg image in a browser and choose the option Copy SVG and the use
Paste Special to paste it into the Word document as a bitmap, which
seems to defeat the object, and in any case any image I right click in
my IE browser that purports to be a svg image is in fact something
else (possibly converted by my browser)? I can't get an svg into my
browser so I can't do that anyway. All this is mostly guess work
though and is just bits and pieces of what I have gleaned in the last
ten minutes from Google.
I could check the API function, but since I will switch to
Jabaco slowly, I should minimise my dependence on Windows
APIs. Once I know the commands used in .wmf and .emf, it
should not be difficult to produce .emf files (particularly
if they are text files like PostScript, which I used to
produce from Fortran programs) straight from VB6 by Print
commands. Do you know of a good Internet site where I can
see simple examples of .wmf/.emf files, and a site where the
commands are listed?
There are millions of .wmf and .emf files on the web if you just want
the graphic files themselves to look at, but I can't at the moment
find anything useful regarding the specific file format. I do know
though that they are certainly not text based files because I've just
loaded a few of them (a few very small ones I created myself and one
or two small files already on my machine) into a Byte array and
examined the contents. There is a tiny bit of text (the word EMF) but
the rest is just numbers. Obviously the numbers it contains will be
various bits of header and intended default image size information
followed by other numbers representing specific graphic operations
(ellipse, lineto, TextOut, etc) and the parameters that relate to them
but I can't find any detailed specification to help me out in
analysing it. You'd probably be able to do it eventually by
deliberately creating small emf files each containing just one or two
specific drawing commands and building up from there once you had got
one specific drawing command analysed but it would be a hard slog
without a reference of some kind to help you. All I know so far is
that they are definitely not text based. I've just downloaded what are
supposed to be the file format descriptions from http://www.wotsit.org
but all they have is the Microsoft description of emf images, which
tells you nothing at all about the actual file format! I do seem to
recall http://www.wotsit.org having a proper detailed description of
the specific file format a long time ago (although I'm not absolutely
certain on that point) but if it ever was the case then Micro$oft have
since "nobbled" them!

Mike
a***@spam.here-abo.fi
2009-07-06 15:24:26 UTC
Permalink
Post by Mike Williams
[Mike Williams said] Check out the CreateEnhMetaFile API
function which will allow your VB6 code to create an
enhanced metafile
[A Bulsari said] OK. Could you please also comment on the
SVG format? Is it incompatible with Word, PowerPoint, etc.
or is there some other trouble with it?
I've never used svg images. As far as I can gather SVG is a XML based
relative newcomer and I think some browsers, including Windows
Explorer, don't support it by default unless you download a suitable
add-on. I certainly can't seem to see any of them when I search for
them. My IE browser appears to convert them to .png and sometimes they
appear as jpegs? I downloaded a 'playing card graphic' with an .svg
extension from the web just now and I can't get it into a MS Word
document. In fact I can't get anything to recognise it at all so I
cannot see what graphic it actually contains. I might be doing
something wrong though because as I said I've never used svg before.
I've just read somewhere that MS Word does not natively support them
and that to get them into a Word document you need to right click the
svg image in a browser and choose the option Copy SVG and the use
Paste Special to paste it into the Word document as a bitmap, which
seems to defeat the object, and in any case any image I right click in
my IE browser that purports to be a svg image is in fact something
else (possibly converted by my browser)? I can't get an svg into my
browser so I can't do that anyway. All this is mostly guess work
though and is just bits and pieces of what I have gleaned in the last
ten minutes from Google.
I tried to look at similar things and came to the conclusion that SVG
is not supported by MS. MS wants to thrust its own formats, which are
less legible (not in text format) and revealed its specifications only
two years back. SVG is not a good alternative, but neither are .wmf or
.emf because they are not in text format, and I can't go and edit the
files manually. Writing binary files is OK, but debugging it becomes a
nuisance.

Is EPS an option? It should be quite similar to PostScript, which I
used to use years back, and even write directly in PostScript. On Unix
there used to be a ps2epsi command which converted my PS files to EPS
or EPSI. Any comments on EPS or other text format vector image files,
which are supported by MS will be very appreciated.
Post by Mike Williams
I could check the API function, but since I will switch to
Jabaco slowly, I should minimise my dependence on Windows
APIs. Once I know the commands used in .wmf and .emf, it
should not be difficult to produce .emf files (particularly
if they are text files like PostScript, which I used to
produce from Fortran programs) straight from VB6 by Print
commands. Do you know of a good Internet site where I can
see simple examples of .wmf/.emf files, and a site where the
commands are listed?
There are millions of .wmf and .emf files on the web if you just want
the graphic files themselves to look at, but I can't at the moment
find anything useful regarding the specific file format. I do know
though that they are certainly not text based files because I've just
loaded a few of them (a few very small ones I created myself and one
or two small files already on my machine) into a Byte array and
examined the contents. There is a tiny bit of text (the word EMF) but
the rest is just numbers. Obviously the numbers it contains will be
various bits of header and intended default image size information
followed by other numbers representing specific graphic operations
(ellipse, lineto, TextOut, etc) and the parameters that relate to them
but I can't find any detailed specification to help me out in
analysing it. You'd probably be able to do it eventually by
deliberately creating small emf files each containing just one or two
specific drawing commands and building up from there once you had got
one specific drawing command analysed but it would be a hard slog
without a reference of some kind to help you. All I know so far is
that they are definitely not text based. I've just downloaded what are
supposed to be the file format descriptions from http://www.wotsit.org
but all they have is the Microsoft description of emf images, which
tells you nothing at all about the actual file format! I do seem to
recall http://www.wotsit.org having a proper detailed description of
the specific file format a long time ago (although I'm not absolutely
certain on that point) but if it ever was the case then Micro$oft have
since "nobbled" them!
Mike
A lot of people have reverse engineered these file formats over the
years, so the information must be there somewhere, even many of them
want to sell little conversion software or DLLs.

With kind regards,

A. Bulsari
Hiker123
2009-07-08 15:00:08 UTC
Permalink
Another Vector format where all the elements are described in Text
is DXF. This vector format is generally used by CAD software.


* * Please include a copy of this message with any reply on this topic

-----

Jeff Bennett


* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* WWW.Bennet-Tec.Com

RELIABLE Component Software
and Custom Software Development Services

* Expert Systems * Text Processing
* Databases * Interactive Web Sites
* Diagramming, Drawing, Hotspot Graphics
* Data Input & Data Presentation Systems
* Decision Support * Web Based Data Collection
* Forecasting * Signature Capture
* Desktop Windows, Tablets, Pocket PCs


TList™ / ALLText™ / MetaDraw™ / Web Signature™

======================== ========================


--------------------------------------------------------------------------------------------------
This message was sent to you by Bennet-Tec Support System
--------------------------------------------------------------------------------------------------
a***@spam.here-abo.fi
2009-07-12 11:16:38 UTC
Permalink
Post by a***@spam.here-abo.fi
Could someone tell me a good format which can easily be included in MS
Office as well as OpenOffice documents? For example, PostScript is a
good format, but cannot be introduced into Word or PowerPoint easily.
I have no idea about wmf and other possible formats. So far I have
plotted graphs on Forms or PictureBoxes and then SavePictured them
into bitmaps, which is not very efficient or clean. These do not
produce pictures in 300 dpi or higher resolution, which most journals
and magazines would like to have.
EPS seems to be one good option. Are there any major limitations of
EPS?

It is easy to write EPS files from VB6, and EPS files can be inserted
into Word files. For plots, it will be a large number of moveto and
lineto or rlineto commands, and a few other lines for the header and
text.
Post by a***@spam.here-abo.fi
Is there some basic open source infrastructure in VB6 for simple vector
graphics?
With kind regards,
A. Bulsari
a***@spam.here-abo.fi
2009-07-23 13:08:25 UTC
Permalink
This post might be inappropriate. Click to display it.
Flavio Henrique da Silva
2016-12-10 20:21:06 UTC
Permalink
Hi, A. Bulsari,

please sample file of your EPS (postscript) import/plotter for MS Office (Excel, Word etc)


thank you very mutch.
Flavio Henrique.

Loading...