Jacques
> In my application I need to show some 200 drawings 640x480. I can not get
> them from bmp or jpg files (bmp too large, jpg loading too slow), so I came
> up with an idea of using a ready program (or making one) that can do things
> similar to windows "paint". That is, for each particular line, triangle,
> ellipse etc., which graphic artist makes, there is also a delphi code
> produced. The generated code can do the same drawing (which the artist
> drew) using Tcanvas methods. I cooperate with the graphic artist. He is
> supposed to produces drawings and I am to recreate the drawings in my
> aplication using the generated source code.
> Does anybody know of such an application (freeware)? If I can not find
> one I will have to write one, which I want to avoid.
Here is an example from Delphi help file that states exactly what I
said:
This example shows how to create or augment a metafile using a metafile
canvas object. This metafile can then be used to draw on the canvas of
another object such as a paintbox or a printer.
MyMetafile := TMetafile.Create;
with TMetafileCanvas.Create(MyMetafile, 0) do
try
Brush.Color := clRed;
Ellipse(0,0,100,100);
...
finally
Free;
end;
PaintBox1.Canvas.Draw(0,0,MyMetafile); {1 red circle }
To add to an existing metafile image, create a metafile canvas and play the
source metafile into the metafile canvas:
with TMetafileCanvas.Create(MyMetafile, 0) do
try
Draw(0,0,MyMetafile);
Brush.Color := clBlue;
Ellipse(100,100,200,200);
...
finally
Free;
end;
Form1.Canvas.Draw(0,0,MyMetafile); {1 red circle and 1 blue circle }
Most vector based illustration software can export to WMF and EMF. ExamplesQuote:>But which graphic application ready to use can save just made
>drawings in wmf format (conversion is out of the question as
>bmp ->wmf would produce a large wmf) ?
Regards,
Wayne
Most vector-based Windows drawing tools can output metafiles. Visio andQuote:> But which graphic application ready to use can save just made drawings in
wmf
> format (conversion is out of the question as bmp ->wmf would produce a
large
> wmf) ?
Sure, works great.Quote:> Having one I could perhaps store wmf files in resource and load them from
> resource ?
It shouldn't take 500 milliseconds to load a 640x480 bmp file, unless youQuote:> Might take just as much time as loading bmp. I need to load one 640x480
image
> in half a second.
Depending on how complex your drawings are, drawing on the screen with
discreet source code operations could take longer than drawing a bitmap.
Drawing with metafiles will have exactly the same performance as drawing
with source code. On NT, metafiles may draw a little bit faster than source
code because of fewer round-trip calls into GDI.
-Danny Thorpe
--
Delphi created here:
http://albums.photopoint.com/j/AlbumIndex?u=57458&a=435308
1. Delphi Programming Source Code mailing list!
Come join our Delphi Programming Source Code mailing list at:
http://members.xoom.com/sandbrook/progpage1.htm
Lots of code and tips to help beginners and all users of Delphi!
--
All the best from James Sandbrook.
****************************************************************
http://members.xoom.com/sandbrook/NewZealand.htm
2. Brodcast quality? Betacam SP or S-VHS
3. Need source codes for simple drawing program.
5. generate GIF file source code
6. Picture Publisher 4.0 Upgrade?
7. Source code to generate linear/log grid lines
9. Generating Random Fractal Terrain, with source code
10. source code for generating Geodesic Domes?
11. Utility to generate OpenGL source code?
12. ANN: New version of TOpenGL (both BCB and Delphi source code)