Loading strings into images/bitmaps

Hi,

I want to read a textfile into a bitmap. How can I best do this?

Thanks
lizzzardAsked:
Who is Participating?
 
michaueCommented:
Why don't you just create an image with paintbrush for all the letters of the alphabet, that way you can put in your own cool letter designs and then draw them on the screen as you read each letter from the file or something like that

That way can also put cool sounds, like a gun shot etc. after each image(letter) is displayed ...

Have fun  Elfrieda
0
 
ysdCommented:
You can try drawing the textfile into the bitmap on runtime..if you run the example that is available on the help file of Delphi 3 under "SaveToStream", you will see that it draws the contents of "P" which is a variable of type TByteArray I think, on the Bitmap, and you can also define using the 'FOR Loops' the Y/X position.   You can also check the drawing bitmap OffScreen....

I hope I've been of some help.

YSD
0
 
heapsterCommented:
Why? (Out of interest).  
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
GreedyCommented:
Must be some sort of new bitmap encryption??
0
 
lizzzardAuthor Commented:
I want to make a screensaver that randomly gets text out of a textfile and puts it on the screen,move it around a bit and so on. Or do you know a better way do to this?
0
 
GreedyCommented:
oh, you mean to draw the text that is in the file so the graphic looks like the letters?  Say they had "TEST" in the file so you want the graphic to look like a little floating image that said TEST...Window 95 and NT have an open GL screen saver called 3D Text that does this.  If this is waht you want I can give you some help on reading in the file and rendering a graphic of it for display.
0
 
lizzzardAuthor Commented:
Yes,that's what I want. The main idea is that there's a textfile with 'famous one-liners'. The screensaver must randomly pick a line (which is ofcourse not the problem) and then let it loose on the screen using some background.
Thanks for your help.
0
 
heapsterCommented:
Bitmap.Canvas.TextOut(X, Y, 'This is my text');      ?
0
 
lizzzardAuthor Commented:
Thanks for you suggestion michaue,but don't you think the exe will grow too large then? It is supposed to be a screensaver. I want it to be under 200k

Regards,Alex
0
 
michaueCommented:
I suppose that depends on your images ...
Otherwise you can down a very nice font from the internet and use that to write to the screen in the normal way (with a large font size) or maybe you can make it a bit more fun by using several different fonts and displaying each letter in a new font, colour and size ...

Hope it works ...

Can you send me a copy when finished, it sounds interesting
0
 
michaueCommented:
I still want a copy if you're finished ... of course if you don't mind.


Elfrieda :)

elfrieda@ats.sani.org
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.