I need a program generating Delphi source code

I need a program generating Delphi source code

Post by Mariusz J?drzejowsk » Thu, 16 Sep 1999 04:00:00



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.
 
 
 

I need a program generating Delphi source code

Post by Jacques Obert » Thu, 16 Sep 1999 04:00:00


Sounds like you could use metafiles to create and store your
drawings. They are very compact and fully supported by Delphi.

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.


 
 
 

I need a program generating Delphi source code

Post by Mariusz J?drzejowsk » Thu, 16 Sep 1999 04:00:00


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) ?
Having one I could perhaps store wmf files in resource and load them from
resource ?
Might take just as much time as loading bmp. I need to load one 640x480 image
in half a second.
   Making my own application that can make drawings and save in wmf format is
just as difficult as generating source code because I do have already the
source that generated the drawing so what do I need conversion to wmf for ?

        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 }

 
 
 

I need a program generating Delphi source code

Post by Wayne Sherma » Fri, 17 Sep 1999 04:00:00


Quote:>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) ?

Most vector based illustration software can export to WMF and EMF.  Examples
include CorelDraw, Adobe Illustrator, MS Draw.

Regards,

Wayne

 
 
 

I need a program generating Delphi source code

Post by Danny Thorp » Fri, 24 Sep 1999 04:00:00



Quote:> 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) ?

Most vector-based Windows drawing tools can output metafiles.  Visio and
Corel Draw come to mind.  If you have a choice, use EMF instead of WMF.  EMF
is much more accurate and less error prone than the old 16 bit WMF format.

Quote:> Having one I could perhaps store wmf files in resource and load them from
> resource ?

Sure, works great.

Quote:> Might take just as much time as loading bmp. I need to load one 640x480
image
> in half a second.

It shouldn't take 500 milliseconds to load a 640x480 bmp file, unless you
have 20 or 30 of them running around in memory and thrashing your swap file.

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.

4. *SLIP INTO ANOTHER WORLD*

5. generate GIF file source code

6. Picture Publisher 4.0 Upgrade?

7. Source code to generate linear/log grid lines

8. Newbie VC++5.0

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)