Visit our Sponsor   Visit our Sponsor
delphi3000.com - the free delphi knowledge platform
delphi3000.com - the free delphi knowledge platform
Have a look at your member-status

connecting people's knowledge


  - Recent ArticlesRSS feed for Recent Articles on delphi3000.com
  - List of All Articles
  - Top Viewed Articles
  - Articles (+Attachem.)
  - Articles Of Interest
  - Categories
  - Top Uploader
  - Search
  - Index

  - My Home
  - Submit an Article
  - My Articles
  - My Personal Data
  - My Bookmarks
  - Activities
  - Login/Logout

  - Sign Up
  - Why Sign Up
  - Newsletter

  - Press
  - Advertise

  - Contact
  - Feedback





Community
Borland
ClubeDelphi
Dr. Bob
UK-BUG
Delphi Meetings
Planeta Delphi







Startblatt.de






Share this article with friendsShare this article with friends
Rate this articleRate this article - to keep the quality of delphi3000.com !
Comment this article or read through previous comments (0)


Make TextOut with 3d-Effect or hollow TextFormat this article printer-friendly!Bookmark function is only available for registered users!
Using of GDI-Paths
Product:
Delphi all versions
Category:
Graphic
Skill Level:
Scoring:
Last Update:
06/26/2002
Search Keys:
delphi delphi3000 article borland vcl code-snippet StrokePath BeginPath EndPath Texteffects
Times Scored:
4
Visits:
3661
Uploader: Holger Voigt
Company: Mediakueche
Reference: N/A
 
Question/Problem/Abstract:
How to make TextOut with 3d-Effect or hollow Text
Answer:



Make a new Application and take this Proc bellow for the OnPaint-Event of the Form. The TextOutput will look like written with a kaligraf.If You replace the for loop in the proc with a single call of textout you can use this code to write "hollow" text. Try it with different Pen-Styles too!
Enjoy it.


procedure TForm1.FormPaint(Sender: TObject);
var HFnt: HFONT; Fontname, Txt: PChar; sze: Size; c: Integer; byt : Byte;
begin
  Fontname := 'Arial';
  txt := 'Mediakueche';
  HFnt := CreateFont(90, 60, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
    PROOF_QUALITY, DEFAULT_PITCH + FF_DONTCARE, Fontname);
  SelectObject(Canvas.Handle, hfnt);
  SetBkMode(Canvas.Handle, TRANSPARENT);
  GetTextExtentPoint32(Canvas.Handle, txt, length(txt), sze);
  BeginPath(Canvas.Handle);
c := 1;
  for c := 0 to 4 do
  begin
    TextOut(Canvas.Handle, 5 + c, 10 + c, Txt, length(Txt));
  end;
  EndPath(Canvas.Handle);
//  Canvas.pen.Style := psDot;
  StrokePath(Canvas.Handle);
  SetBkMode(Canvas.Handle, OPAQUE);

  DeleteObject(SelectObject(Canvas.Handle, GetStockObject(WHITE_BRUSH)));
  SelectObject(Canvas.Handle, GetStockObject(SYSTEM_FONT));
  DeleteObject(HFnt);

end;





Please rate this article!
Skill level:
BeginnerExpert

Useful:
No!Very!

Overall rating:
PoorExcellent



Comments to this article
Write a new comment













 
Sign up to consume product discounts for Bronze memberships !

read more


  Visit our Sponsor

 

  Community Ad of
M. Maes
 
   














 







     
  Copyright © 2000 - 2007 delphi3000.com - All rights reserved. Terms of use. || Privacy
delphi3000.com is a service by bluestep.com IT-Services GmbH (Vienna)