Article View: borland.public.cppbuilder.nativeapi
Article #1453Re: quick data copy between objects
From: Asger Jorgensen
Date: Wed, 01 Aug 2007 22:20
Date: Wed, 01 Aug 2007 22:20
57 lines
2538 bytes
2538 bytes
Hi Robert I don't know if this is any help at all, but most of the times GIF is a better format for screen captures it produces smaller files. Program surfaces usually don't more thatn 256 colors. There is a gif component at Tory that looks good TGIFImage v.2.2 Freeware with source: http://www.torry.net/quicksearchd.php?String="TGIFImage&Title=Yes Kind regards Asger In article <46b0f5c4$1@newsgroups.borland.com>, not.a.real.address@anywhere.sorry says... > Hi All, > > I've got a timing/performance need... I'm trying to capture the screen as BMP, > compress to JPG, then send over a TCustomWinSocket. I'm afraid it just takes too > long... :( Here's what I've got going on... > > ... > > > // capture entire screen and copy data to TBitmap > BitBlt(ImageBMP->Canvas->Handle, > 0, 0, ImageBMP->Width, ImageBMP->Height, > hCaptureDC, 0, 0, SRCCOPY); > > // convert to JPG > ImageJPG->Assign(ImageBMP); > > // convert to memory stream for sending over socket > ImageJPG->SaveToStream(WriteStream); > > // disable Nagle algorithm to speed up transmissions??? > TWinSocket_SetSockOpt(SocketOut, IPPROTO_TCP, TCP_NODELAY, 1); > > // send image data to client > SocketOut->SendBuf(WriteStream->Memory, WriteStream->Size); > > // reset stream for next use > WriteStream->Clear(); > > > ... > > > So, is there any way to speed up any or all of these operations? It takes (as > near as I can measure) ~1.5 seconds to send over the data. Any and all advice is > much appreciated... > > Many thanks! > > Rob >
Technical Details
Message-ID:
<MPG.211b25bac4d7784e9897c7@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<46b0f5c4$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2f02e67f1be3ea63 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Asger Jorgensen <Junk@Asger-P.dk> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: quick data copy between objects Date: Thu, 2 Aug 2007 00:20:59 +0200 Message-ID: <MPG.211b25bac4d7784e9897c7@newsgroups.borland.com> References: <46b0f5c4$1@newsgroups.borland.com> Organization: Asger-P MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/2.70.2067 NNTP-Posting-Host: 83.73.213.92 X-Trace: newsgroups.borland.com 1186006979 83.73.213.92 (1 Aug 2007 15:22:59 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail