Article View: borland.public.cppbuilder.nativeapi
Article #10268GetCharWidth( ) and printing
From: LarryJ
Date: Tue, 11 May 2004 21:26
Date: Tue, 11 May 2004 21:26
15 lines
1451 bytes
1451 bytes
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. When I pass the hdc handle of a Paintbox canvas for drawing to the screen the width is returned as 7 and it works fine. 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); Thanks Larry.
Technical Details
Message-ID:
<40a144e2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,27194c3be69ec667,start X-Google-Attributes: gid10cc67,public Reply-To: "LarryJ" <LarryJ33@ev1.net> From: "LarryJ" <LarryJ33@ev1.net> Newsgroups: borland.public.cppbuilder.nativeapi Subject: GetCharWidth( ) and printing Date: Tue, 11 May 2004 16:26:05 -0500 Lines: 17 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 216.40.234.167 Message-ID: <40a144e2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1084310754 216.40.234.167 (11 May 2004 14:25:54 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail