Solved

Loading strings into images/bitmaps

Posted on 1998-06-03
11
219 Views
Last Modified: 2013-12-02
Hi,

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

Thanks
0
Comment
Question by:lizzzard
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 2

Expert Comment

by:ysd
Comment Utility
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
 

Expert Comment

by:heapster
Comment Utility
Why? (Out of interest).  
0
 
LVL 1

Expert Comment

by:Greedy
Comment Utility
Must be some sort of new bitmap encryption??
0
 

Author Comment

by:lizzzard
Comment Utility
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
 
LVL 1

Expert Comment

by:Greedy
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:lizzzard
Comment Utility
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
 

Expert Comment

by:heapster
Comment Utility
Bitmap.Canvas.TextOut(X, Y, 'This is my text');      ?
0
 
LVL 1

Accepted Solution

by:
michaue earned 50 total points
Comment Utility
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
 

Author Comment

by:lizzzard
Comment Utility
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
 
LVL 1

Expert Comment

by:michaue
Comment Utility
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
 
LVL 1

Expert Comment

by:michaue
Comment Utility
I still want a copy if you're finished ... of course if you don't mind.


Elfrieda :)

elfrieda@ats.sani.org
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now