Solved

Text to Bmp

Posted on 2001-08-19
6
308 Views
Last Modified: 2010-04-06
If i use a text entry box how can i save the text as a .bmp




0
Comment
Question by:neopolis
  • 2
  • 2
  • 2
6 Comments
 
LVL 3

Expert Comment

by:Slavak
ID: 6403561
Try it,

 Bmp := TBitmap.Create;
 Try
  With Bmp Do Begin
   Canvas.Font.Assign(Edit1.Font);
   Width  := Canvas.TextWidth(Edit1.Text);
   Height := Canvas.TextHeight(Edit1.Text);
   Canvas.TextOut(0, 0, Edit1.Text);
   SaveToFile(FileName);
  End;
 finally
  Bmp.Free;
 end;
0
 

Author Comment

by:neopolis
ID: 6404238
Looks good
can you email a demo made i am new at delphi
thanks
0
 
LVL 5

Expert Comment

by:Gwena
ID: 6404609
Hi neopolis :-)

 Here is slavak's code installed in a buttonclick procedure
maybe this will help you... just start delphi and add a button and an edit box to your form... then double click the button to make an event handler... then just replace that button code with this... it will save the text that is in the edit box to a file called TxtBmp.bmp ..it saves it to the floppy drive but you can change it to any drive :-)



procedure TForm1.Button1Click(Sender: TObject);
var MyBmp: tbitmap;
begin
  MyBmp := TBitmap.Create;
  Try
  With MyBmp Do
    Begin
      Canvas.Font.Assign(Edit1.Font);
      Width  := Canvas.TextWidth(Edit1.Text);
      Height := Canvas.TextHeight(Edit1.Text);
      Canvas.TextOut(0, 0, Edit1.Text);
      SaveToFile('A:\TxtBmp.bmp');
    End;
  finally
  MyBmp.Free;
  end;
end;

0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 3

Accepted Solution

by:
Slavak earned 10 total points
ID: 6405289
Thanks, Gwena :)
0
 
LVL 5

Expert Comment

by:Gwena
ID: 6405314
:-)
0
 

Author Comment

by:neopolis
ID: 6406591
Thank you Slavak and Gwena
your explanation was easy for me to follow
i am new very much appreciated again Thank You..
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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