Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 8th, 2005, 04:12 PM
lubos lubos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 2 lubos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 45 m 44 sec
Reputation Power: 0
Textextent problem

How one can find out in Delphi 6 for an arbitrary font and for its arbitrary Font.Size and Font.Style (e.g. italic, bold, underline) the most exact dimensions of an rectangle it will occupy in a bitmap?

I need it as I am working on a vector graphic editor. Each objet (circle, text,...) can be moved around. While an object is being moved around, it is framed by an red rectangle.

I’ve tried to use functions Image.Canvas.TextWidth and Image.Canvas.TextHeight and also Image.Canvas.TextExtent from libraries for VCL (Graphics.pas) and their analogies from CLX library (QGraphics.pas). But all these functions returned small values (some parts of the text weren’t visible) when using Font.Size > 40 (depending on the font type and on concrete font s well) and using Font.Style other than regular (i.e. italic or bold).

Does anybody have an idea how to work it arround?

Thank You in advance
Lubos Doborovda.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Textextent problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT