🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #2413

Re: Getting text from an external Grid

#2413
From: Bob Gonder
Date: Thu, 01 Mar 2007 17:14
22 lines
1863 bytes
Dan wrote:

>(1) I couldn't access the pixels unless the dialog I was copying was 
>visibly on the screen;

You might try BringWindowToTop( hWnd )

>(2) I couldn't find a clear way to get the height and width, in pixels, 
>of the target I was copying.  Is there a way to grab the height in 
>pixels of the target handle or DC?

W = GetDeviceCaps( hDC, HORZRES );
H = GetDeviceCaps( hDC, VERTRES );

See the topic "Capturing an Image" in the BCB/BDS helps

>(3), I had to enlarge the image by a factor of two.

See the very next topic: "Scaling an Image"

Basically, besides adjusting the size of the created bitmap, you use
StretchBlt instead of BitBlt to capture the image.
Technical Details
Message-ID: <lnvdu29ua6a88fpbfof4eu9pb4d7t42pm4@4ax.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45e59a3a$1@newsgroups.borland.com> <45e5bb7e$1@newsgroups.borland.com> <45e5cfa5$1@newsgroups.borland.com> <45e5f6d3@newsgroups.borland.com> <45e5fd07$1@newsgroups.borland.com> <45e60f88$1@newsgroups.borland.com> <45e6f2f0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3d58209a1f02789a
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Getting text from an external Grid
Date: Thu, 01 Mar 2007 09:14:43 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <lnvdu29ua6a88fpbfof4eu9pb4d7t42pm4@4ax.com>
References: <45e59a3a$1@newsgroups.borland.com> <45e5bb7e$1@newsgroups.borland.com> <45e5cfa5$1@newsgroups.borland.com> <45e5f6d3@newsgroups.borland.com> <45e5fd07$1@newsgroups.borland.com> <45e60f88$1@newsgroups.borland.com> <45e6f2f0$1@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: 67.77.145.101
X-Trace: newsgroups.borland.com 1172769273 67.77.145.101 (1 Mar 2007 09:14:33 -0800)
Lines: 24
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!news2.google.com!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail