[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

What is the best/easy way to make (Vertical Caption/Vertical Button)?

What is the best/easy way to make (Vertical Caption/Vertical Button)?

like

|T|
|E|
|S|
|T|

but of course the letters must be at 90 degree




500 points for this one, thx in advance
Sans-titre.jpg
0
Marc582
Asked:
Marc582
  • 3
3 Solutions
 
CodedKCommented:
Hello Marc.

Well i use this : "TAPIText"
http://sintreseng.narod.ru/TAPIText.zip
Its only 18kb and its free.

It can draw text in any angle and has some more features.
It has the source and everything so you can check it out.

Hope this helps
0
 
ziolkoCommented:
little sample

procedure TForm1.Button1Click(Sender: TObject);
var lf: LOGFONT;
    hf: THandle;
begin
  hf := CreateFont(-11, 0, 90, 90, FW_DONTCARE, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH or FF_DONTCARE, 'Arial');
  try
    SelectObject(Canvas.Handle, hf);
    Canvas.TextOut(200, 200, 'upside down');
  finally
    DeleteObject(hf);
  end;
end;

you can make same yhing with canvas of your new button,
also you dont have to create/delete font each time you draw

ziolko.
0
 
ziolkoCommented:
little change:
procedure TForm1.Button1Click(Sender: TObject);
var lf: LOGFONT;
    hf: THandle;
begin
  hf := CreateFont(-11, 0, -900, 0, FW_DONTCARE, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH or FF_DONTCARE, 'Arial');
  try
    SetGraphicsMode(Canvas.Handle, GM_ADVANCED);
    SelectObject(Canvas.Handle, hf);
    Canvas.TextOut(200, 200, 'upside down');
  finally
    DeleteObject(hf);
  end;
end;

ziolko.
0
 
Marc582Author Commented:
when we use the canvas, when the user minimize the form or move another window over it, the text draw by canvas is overwritten no?

so not really good, correct me if I'm wrong
0
 
ziolkoCommented:
not only when you minimize app but also when you place other window over yours,
if you want contents of canvas to stay even after window is minimized use OnPaint event handler of form  or if you wanr separate component you must catch catch WM_PAINT message

ziolko.
0

Featured Post

2018 Annual Membership Survey

Here at Experts Exchange, we strive to give members the best experience. Help us improve the site by taking this survey today! (Bonus: Be entered to win a great tech prize for participating!)

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now