🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Getting text from an external Grid

#2418
From: Remy Lebeau (TeamB)
Date: Thu, 01 Mar 2007 21:12
33 lines
2212 bytes
"Dan" <Dan@do.not.spam> wrote in message
news:45e73ae4@newsgroups.borland.com...

>    HANDLE HandleToTheGrid = HANDLE(HexIdOfGrid);

What is HexIdOfGrid?

>    Unfortunetly, w and h are always the same, and equal to the
> application.

Then you are not using the correct HDC.

Try using GetWindowRect() instead, using the grid's HWND.

> To get pixels, I am looping from 0 to height within a 0 to width
loop
> where I get the color of the pixel with GetPixel(DCToTheGrid,x,y);
> and then paint it to a TImage using
ImageClassPointer->Canvas->Pixels[x][y]
> = c;

Again, you do not need to access the individual pixels.  Once you have
a suitable HDC, you can BitBlt() or StretchBlt() the entire window to
a bitmap, and then use that as needed.  For example:

    ImageClassPointer->Picture->Bitmap->Width = width;
    ImageClassPointer->Picture->Bitmap->Height = height;
    ::BitBlt(ImageClassPointer->Canvas->Handle, 0, 0, width, height,
DCToTheGrid, 0, 0, SRCCOPY);


Gambit
Technical Details
Message-ID: <45e7425f$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!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> <lnvdu29ua6a88fpbfof4eu9pb4d7t42pm4@4ax.com> <45e72444$1@newsgroups.borland.com> <45e733b3$1@newsgroups.borland.com> <45e73ae4@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: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
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> <lnvdu29ua6a88fpbfof4eu9pb4d7t42pm4@4ax.com> <45e72444$1@newsgroups.borland.com> <45e733b3$1@newsgroups.borland.com> <45e73ae4@newsgroups.borland.com>
Subject: Re: Getting text from an external Grid
Date: Thu, 1 Mar 2007 13:12:07 -0800
Lines: 35
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: 75.83.34.171
Message-ID: <45e7425f$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1172783711 75.83.34.171 (1 Mar 2007 13:15:11 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail