Article View: borland.public.cppbuilder.nativeapi
Article #10273Re: GetCharWidth( ) and printing
From: Bob Gonder
Date: Wed, 12 May 2004 01:43
Date: Wed, 12 May 2004 01:43
17 lines
1662 bytes
1662 bytes
LarryJ wrote: >I am using the GetCharWidth( ) API seen below to get the width of a single >digit. I use this to calculate the rectangle coordinates around the text so >I can draw an ellipse around the text. > The problem occurs when I pass the printer canvas handle the >width returns as 57 and the ellipse around the text prints too large. I am >not sure why the Paintbox canvas handle and the printer canvas handle return >different results. > > >int width >GetCharWidth(hdc, 9, 9, &width); Isn't that a tab character you're testing? You might want to use an 'm', 'n' or 'w' width instead. Or, if digits, perhaps a '9' instead of a 9.
Technical Details
Message-ID:
<kkv2a09t4tskllbfh0507rr401ku0saqlk@4ax.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.wirehub.nl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40a144e2@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,27194c3be69ec667 X-Google-Attributes: gid10cc67,public From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: GetCharWidth( ) and printing Date: Tue, 11 May 2004 18:43:50 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <kkv2a09t4tskllbfh0507rr401ku0saqlk@4ax.com> References: <40a144e2@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 69.69.255.205 X-Trace: newsgroups.borland.com 1084326226 69.69.255.205 (11 May 2004 18:43:46 -0700) Lines: 20 Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.wirehub.nl!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail