Solved

Loading strings into images/bitmaps

Posted on 1998-06-03
11
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 2

Expert Comment

by:ysd
ID: 1350099
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
ID: 1350100
Why? (Out of interest).  
0
 
LVL 1

Expert Comment

by:Greedy
ID: 1350101
Must be some sort of new bitmap encryption??
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lizzzard
ID: 1350102
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
ID: 1350103
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
 

Author Comment

by:lizzzard
ID: 1350104
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
ID: 1350105
Bitmap.Canvas.TextOut(X, Y, 'This is my text');      ?
0
 
LVL 1

Accepted Solution

by:
michaue earned 50 total points
ID: 1350106
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
ID: 1350107
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
ID: 1350108
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
ID: 1350109
I still want a copy if you're finished ... of course if you don't mind.


Elfrieda :)

elfrieda@ats.sani.org
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

718 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