Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vertical texts on Canvas.

Posted on 1999-07-08
6
Medium Priority
?
330 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
[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
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
Independent Software Vendors: 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: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

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

722 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