🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.graphics
Article #2

Re: Text Extent?

#2
From: Marc Rohloff TeamB
Date: Thu, 06 Apr 2006 22:43
13 lines
1639 bytes
On Thu, 6 Apr 2006 18:06:32 -0400, Ron Sawyer wrote:

> I am using C# to do some graphics development.  I have to output a small
> graphic to a canvas and center a string under it.  In the windows API world
> I would get the extent of the text (I think it was called GetTextExtent or
> something similar, I'd have to look it up.)  I would use the resultant width
> and height to help me center the text output.

Get hold of a Graphics object and call the MeasureString method.

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID: <1goyhltdhened$.dlg@dlg.marcrohloff.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <443590d2$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 13f327,8cefa56ffbdd0002
X-Google-Attributes: gid13f327,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: Text Extent?
Newsgroups: borland.public.csharpbuilder.graphics
User-Agent: 40tude_Dialog/2.0.15.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <443590d2$1@newsgroups.borland.com>
Date: Thu, 6 Apr 2006 18:43:46 -0400
Message-ID: <1goyhltdhened$.dlg@dlg.marcrohloff.com>
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ :0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
X-Antivirus: avast! (VPS 0614-2, 04/06/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 65.31.1.121
X-Trace: newsgroups.borland.com 1144363423 65.31.1.121 (6 Apr 2006 15:43:43 -0700)
Lines: 13
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail