?
Solved

Vertical texts on Canvas.

Posted on 1999-07-08
6
Medium Priority
?
337 Views
Last Modified: 2010-04-06
I want to write a text on a Canvas with the instruction
Canvas.TextOut(0,0,'text');
and I want the writing be vertical. What I have to do?
0
Comment
Question by:val84
  • 3
  • 3
6 Comments
 
LVL 13

Accepted Solution

by:
Epsylon earned 200 total points
ID: 1387214
Try this. I works for me  :o)

var
  lf : TLogFont;
  tf : TFont;
begin
  with Form1.Canvas do begin
    Font.Name := 'Arial';
    Font.Size := 24;
    tf := TFont.Create;
    tf.Assign(Font);
    GetObject(tf.Handle, sizeof(lf), @lf);
    lf.lfEscapement := 900;  // angle, in tenths of degrees
    lf.lfOrientation := 900; // angle, in tenths of degrees
    tf.Handle := CreateFontIndirect(lf);
    Font.Assign(tf);
    tf.Free;
    TextOut(20, Height div 2, 'Rotated Text!');
  end;
end;

0
 

Author Comment

by:val84
ID: 1387215
Hi Epsylon

I tested your solution and it works fine. I wonder why such tools are not documented in Delphi's Help.

Regards, Alex.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1387216
Docs are never up to date but lots of stuff can be found on the internet. The problem is where to look.

Eps.
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 

Author Comment

by:val84
ID: 1387217
Hi Epsylon

As I told you, your procedure works OK, but only on the SCRREN. When I tried to apply it on Printer.Canvas it doesn't work anymore. Have you any idea what I have to do for writing rotated texts on Printer.Canvas?  
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1387218
It should work but I don't have a working printer here right now so I can't try...
0
 

Author Comment

by:val84
ID: 1387219
OK, when you get a printer let me know.

Cheers, Alex.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

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 this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…

601 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