Images from DOS text files.

Images from DOS text files.

Post by Israel Nemlic » Wed, 24 Nov 1999 04:00:00



Hello,
How to create Images from DOS text (Ascii) files?

TIA
Israel Nemlich

 
 
 

Images from DOS text files.

Post by David Boiss » Thu, 25 Nov 1999 04:00:00


Israel,

I assume you mean you want to read text from a file and draw that text on a
graphic.  I don't have an example, but here are some thoughts.

1) Prepare your graphic for drawing(i.e. create and initialize, set font,
create TCanvas if not already created).
2) Read the text into something like a TStringList for convenience.
3) Use the canvas.TextHeight function combined with the TStringList.Count to
size the graphic.
4) Using Canvas.TextOut, draw the text line-by-line.  Increment your "y" by
the same TextHeight function for each successive line.

--
-Dave

 
 
 

Images from DOS text files.

Post by Israel Nemlic » Mon, 29 Nov 1999 04:00:00


David,

Thanks for your response and sorry for my delayed response (vacation).

I get data from a host (Dos Ascii) file and and have to convert it to Windows
Ansi.
The problem is that the data contains Hebrew and English text and to translate
it to Ansi can cause quit a good headache
The data becomes an image at the end of the process.
I thought that if I could make an image out of the text file (Dos) I will not
have to convert
it to Ansi.
Is any way to do it.

TIA
Israel Nemlich


> Israel,

> I assume you mean you want to read text from a file and draw that text on a
> graphic.  I don't have an example, but here are some thoughts.

> 1) Prepare your graphic for drawing(i.e. create and initialize, set font,
> create TCanvas if not already created).
> 2) Read the text into something like a TStringList for convenience.
> 3) Use the canvas.TextHeight function combined with the TStringList.Count to
> size the graphic.
> 4) Using Canvas.TextOut, draw the text line-by-line.  Increment your "y" by
> the same TextHeight function for each successive line.

> --
> -Dave

 
 
 

Images from DOS text files.

Post by David Boiss » Tue, 30 Nov 1999 04:00:00


Israel,

I can draw text on a graphic, but I do not know the issues in handling
Hebrew characters.  I'm sorry.

--
-Dave

 
 
 

Images from DOS text files.

Post by Israel Nemlic » Tue, 30 Nov 1999 04:00:00


Dave

Thanks
Israel Nemlich


> Israel,

> I can draw text on a graphic, but I do not know the issues in handling
> Hebrew characters.  I'm sorry.

> --
> -Dave